5.3. Copy, Move, or Delete a File or a Directory
You need to copy, move, or delete a file or directory.
You have two main options for manipulating files and directories. One option is to create a System. IO.FileInfo object for a file or a System.IO.DirectoryInfo object for a directory, supplying the path in the constructor. You can then use the object's methods to copy, move, and delete the file or directory. Alternatively, you can use the My.Computer.FileSystem class and its Shared methods.
How It Works
The FileInfo, DirectoryInfo, and My.Computer.FileSystem classes include a host of valuable methods for manipulating files and directories. Table 5-3 shows methods for the FileInfo class, Table 5-4 shows methods for the DirectoryInfo ...