CreateDirectory can create a sequence of subdirectories
Directory.CreateDirectory(@"c:\dir1\dir2\dir3");
will create all three directories if they don't already exist.
A little bit of custom DateTime formatting will get you what you want.
[^]
Directory.CreateDirectory(DateTime.Now.ToString(@"c:\yyyy\MMMM\dd"));
[EDIT] sorry that was complete nonsense, this will work:
private static void CreateDirectories() {
DateTime current = DateTime.Now;
String name = String.Format(@"v:\{0:yyyy}\{1:MMMM}\{2:dd}", current, current, current);
try {
Directory.CreateDirectory(name);
} catch (Exception e) {
Console.WriteLine(e);
}
}
Alan.