FileSystemInfo Class
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Provides the base class for both FileInfo and DirectoryInfo objects.
Inheritance Hierarchy
System. . :: . .Object
System. . :: . .MarshalByRefObject
System.IO..::..FileSystemInfo
System.IO. . :: . .DirectoryInfo
System.IO. . :: . .FileInfo
Namespace: System.IO
Assembly: System.IO (in System.IO.dll)
Syntax
'Declaration
Public MustInherit Class FileSystemInfo _
Inherits MarshalByRefObject
public abstract class FileSystemInfo : MarshalByRefObject
public ref class FileSystemInfo abstract : public MarshalByRefObject
[<AbstractClass>]
type FileSystemInfo =
class
inherit MarshalByRefObject
end
public abstract class FileSystemInfo extends MarshalByRefObject
The FileSystemInfo type exposes the following members.
Constructors
Name | Description | |
---|---|---|
FileSystemInfo | Initializes a new instance of the FileSystemInfo class. |
Top
Properties
Name | Description | |
---|---|---|
Attributes | Gets or sets the attributes for the current file or directory. | |
CreationTime | Gets or sets the creation time of the current file or directory. | |
CreationTimeUtc | Gets or sets the creation time, in coordinated universal time (UTC), of the current file or directory. | |
Exists | Gets a value indicating whether the file or directory exists. | |
Extension | Gets the string representing the extension part of the file. | |
FullName | Gets the full path of the directory or file. | |
LastAccessTime | Gets or sets the time the current file or directory was last accessed. | |
LastAccessTimeUtc | Gets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed. | |
LastWriteTime | Gets or sets the time when the current file or directory was last written to. | |
LastWriteTimeUtc | Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to. | |
Name | 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. |
Top
Methods
Name | Description | |
---|---|---|
Delete | Deletes a file or directory. | |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Refresh | Refreshes the state of the object. | |
RefreshIfNull | If information from the native file system has not yet been retrieved, retrieves it. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Fields
Name | Description | |
---|---|---|
m_fullPath | Represents the fully qualified path of the directory or file. |
Top
Remarks
The FileSystemInfo class contains methods that are common to file and directory manipulation. A FileSystemInfo object can represent either a file or a directory, thus serving as the basis for FileInfo or DirectoryInfo objects. Use this base class when parsing a lot of files and directories.
A derived class can inherit from FileSystemInfo only if the derived class has the AllAccess permission from the FileIOPermissionAccess enumeration.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.