Click or drag to resize
DirectoryInfo Class
Exposes instance methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited.
Inheritance Hierarchy
SystemObject
  SystemMarshalByRefObject
    System.IOFileSystemInfo
      System.IODirectoryInfo

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
[SerializableAttribute]
public sealed class DirectoryInfo : FileSystemInfo

The DirectoryInfo type exposes the following members.

Methods
  NameDescription
Public methodCreate
Creates a directory.
Public methodCreate(DirectorySecurity)
Creates a directory using a DirectorySecurity object.
Public methodDelete
Deletes a file or directory.
(Inherited from FileSystemInfo.)
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodRefresh
Refreshes the state of the object.
(Inherited from FileSystemInfo.)
Public methodToString
Returns the original path that was passed by the user.
(Overrides ObjectToString.)
Top
Properties
  NameDescription
Public propertyExists
Gets a value indicating whether the file or directory exists.
(Inherited from FileSystemInfo.)
Public propertyExtension
Gets the string representing the extension part of the file.
(Inherited from FileSystemInfo.)
Public propertyFullName
Gets the full path of the directory or file.
(Inherited from FileSystemInfo.)
Public propertyName
For files, gets the name of the file. For directories, gets the name of the last directory in the hierarchy if a hierarchy exists. Otherwise, the Name property gets the name of the directory.
(Inherited from FileSystemInfo.)
Top
See Also