FileSystemInfo Class

FileSystemInfo Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Provides the base class for both FileInfo and DirectoryInfo objects.


Namespace:  System.IO
Assembly:  mscorlib (in mscorlib.dll)

public abstract class FileSystemInfo

The FileSystemInfo type exposes the following members.

Protected methodFileSystemInfoSecurity Critical. Initializes a new instance of the FileSystemInfo class.

Public propertyAttributesGets or sets the FileAttributes of the current FileSystemInfo.
Public propertyCreationTimeGets or sets the creation time of the current FileSystemInfo object.
Public propertyExistsGets a value indicating whether the file or directory exists.
Public propertyExtensionGets the string representing the extension part of the file.
Public propertyFullNameGets the full path of the directory or file.
Public propertyLastAccessTimeGets or sets the time the current file or directory was last accessed.
Public propertyLastWriteTimeGets or sets the time when the current file or directory was last written to.
Public propertyNameFor 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.

Public methodDeleteDeletes a file or directory.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRefreshRefreshes the state of the object.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Protected fieldFullPathInfrastructure. Represents the fully qualified path of the directory or file.
Protected fieldOriginalPathInfrastructure. The path originally specified by the user, whether relative or absolute.

Version Notes

Windows Phone

This type is present to support the .NET Compact Framework infrastructure in Windows Phone, and it is not intended to be used in your application code.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

© 2017 Microsoft