Managing the File System C# Help

The classes that are used to browse around the file system and perform operations such as moving, copying, and deleting files are shown.

Figure 25-1

Figure 25-1

The following list explains the function of these classes:

¤ System.MarshalByRefObject-This is the base object class for .NET classes that are remotable; permits marshaling of data between application domains.

¤ FileSystemlnfo – This is the base class that represents any file system object.

¤ Filelnfo and File – These classes represent a file on the file system.

¤ Directorylnfo and Directory – These classes represent a folder on the file system.

¤ Path – This class contains static members that you can use to manipulate path names.

¤ Drivelnfo – This class provides properties and methods that provide information, on a selected drive.

On Windows, the objects that contain files and that are used to organize the file system are termed folders.

For example, in the path c. \My Documents \ReadMe. txt, ReadMe.txt is afile and My Documents is a folder.

Folder is a very Windows-specific term: on virtually every other operating system the term directory is used in place of folder, and in accordance with Microsoft’s goal to design .NET as a platform-independent technology, the corresponding .NET base classes are called Directory and Directorylnfo.

However, due to the potential for confusion with LDAP directories, This is a Windows book, we’ll stick to the term folder in this discussion.

Posted on October 28, 2015 in Manipulating Files and the Registry

Share the Story

Back to Top