August 2003
Beginner
600 pages
12h 55m
English
Manipulating directories (folders) is very similar to manipulating files. However, rather than using System.IO.File, you use System.IO.Directory. Notice that when you specify a directory path, double slashes are used instead of just one. If any of these method calls confuse you, see the previous section on System.IO.File for more detailed information. Following are the method calls:
System.IO.Directory.CreateDirectory()— Used to create a directory. You must pass it the name of the new folder as shown here (note that, as discussed in Hour 11, you must preference literal strings containing slashes with the @ character):
System.IO.Directory.CreateDirectory(@"c:\my new directory");
System.IO.Directory.Exists()— ...
Read now
Unlock full access