O'Reilly logo

C# 5.0 Programmer's Reference by Rod Stephens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix S Filesystem Classes

This appendix describes the .NET Framework’s filesystem classes. It also summarizes methods you can use to manage the recycle bin.

Framework Classes

The System.IO namespace provides several classes for working with the filesystem. The following sections describe the properties, methods, and events provided by these classes.

Directory

The Directory class provides static methods for working with directories. The following table summarizes those static methods.

MethodPurpose
CreateDirectoryCreates a directory and any missing directories along its path.
DeleteDeletes a directory and its contents. It can recursively delete all subdirectories.
ExistsReturns true if the path points to an existing directory.
GetCreationTimeReturns a directory’s creation date and time.
GetCreationTimeUtcReturns a directory’s creation date and time in Coordinated Universal Time (UTC).
GetCurrentDirectoryReturns the application’s current working directory.
GetDirectoriesReturns an array of strings holding the fully qualified names of a directory’s subdirectories.
GetDirectoryRootReturns the directory root for a path, which need not exist (for example, C:\).
GetFilesReturns an array of strings holding the fully qualified names of a directory’s files.
GetFileSystemEntriesReturns an array of strings holding the fully qualified names of a directory’s files and subdirectories.
GetLastAccessTimeReturns a directory’s last access date and time.
GetLastAccessTimeUtc

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required