Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DirectoryInfo Methods

The DirectoryInfo type exposes the following members.

  Name Description
Public method Create() Creates a directory.
Public method Create(DirectorySecurity) Creates a directory using a DirectorySecurity object.
Public method CreateObjRef Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)
Public method CreateSubdirectory(String) Creates a subdirectory or subdirectories on the specified path. The specified path can be relative to this instance of the DirectoryInfo class.
Public method CreateSubdirectory(String, DirectorySecurity) Creates a subdirectory or subdirectories on the specified path with the specified security. The specified path can be relative to this instance of the DirectoryInfo class.
Public method Delete() Deletes this DirectoryInfo if it is empty. (Overrides FileSystemInfo.Delete().)
Public method Delete(Boolean) Deletes this instance of a DirectoryInfo, specifying whether to delete subdirectories and files.
Public method EnumerateDirectories() Returns an enumerable collection of directory information in the current directory.
Public method EnumerateDirectories(String) Returns an enumerable collection of directory information that matches a specified search pattern.
Public method EnumerateDirectories(String, SearchOption) Returns an enumerable collection of directory information that matches a specified search pattern and search subdirectory option.
Public method EnumerateFiles() Returns an enumerable collection of file information in the current directory.
Public method EnumerateFiles(String) Returns an enumerable collection of file information that matches a search pattern.
Public method EnumerateFiles(String, SearchOption) Returns an enumerable collection of file information that matches a specified search pattern and search subdirectory option.
Public method EnumerateFileSystemInfos() Returns an enumerable collection of file system information in the current directory.
Public method EnumerateFileSystemInfos(String) Returns an enumerable collection of file system information that matches a specified search pattern.
Public method EnumerateFileSystemInfos(String, SearchOption) Returns an enumerable collection of file system information that matches a specified search pattern and search subdirectory option.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method GetAccessControl() Gets a DirectorySecurity object that encapsulates the access control list (ACL) entries for the directory described by the current DirectoryInfo object.
Public method GetAccessControl(AccessControlSections) Gets a DirectorySecurity object that encapsulates the specified type of access control list (ACL) entries for the directory described by the current DirectoryInfo object.
Public method GetDirectories() Returns the subdirectories of the current directory.
Public method GetDirectories(String) Returns an array of directories in the current DirectoryInfo matching the given search criteria.
Public method GetDirectories(String, SearchOption) Returns an array of directories in the current DirectoryInfo matching the given search criteria and using a value to determine whether to search subdirectories.
Public method GetFiles() Returns a file list from the current directory.
Public method GetFiles(String) Returns a file list from the current directory matching the given search pattern.
Public method GetFiles(String, SearchOption) Returns a file list from the current directory matching the given search pattern and using a value to determine whether to search subdirectories.
Public method GetFileSystemInfos() Returns an array of strongly typed FileSystemInfo entries representing all the files and subdirectories in a directory.
Public method GetFileSystemInfos(String) Retrieves an array of strongly typed FileSystemInfo objects representing the files and subdirectories that match the specified search criteria.
Public method GetFileSystemInfos(String, SearchOption) Retrieves an array of FileSystemInfo objects that represent the files and subdirectories matching the specified search criteria.
Public method GetHashCode Serves as the default hash function. (Inherited from Object.)
Public method GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method GetObjectData Sets the SerializationInfo object with the file name and additional exception information. (Inherited from FileSystemInfo.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Public method InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
Public method MoveTo Moves a DirectoryInfo instance and its contents to a new path.
Public method Refresh Refreshes the state of the object. (Inherited from FileSystemInfo.)
Public method SetAccessControl Applies access control list (ACL) entries described by a DirectorySecurity object to the directory described by the current DirectoryInfo object.
Public method ToString Returns the original path that was passed by the user. (Overrides Object.ToString().)
Top
Show:
© 2014 Microsoft