Partager via


FileSystemInfo Class

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Provides the base class for both FileInfo and DirectoryInfo objects.

Inheritance Hierarchy

System.Object
  System.IO.FileSystemInfo
    System.IO.DirectoryInfo
    System.IO.FileInfo

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

Syntax

'Declaration
<ComVisibleAttribute(True)> _
Public MustInherit Class FileSystemInfo
[ComVisibleAttribute(true)]
public abstract class FileSystemInfo

The FileSystemInfo type exposes the following members.

Constructors

  Name Description
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 FileSystemInfo Initializes a new instance of the FileSystemInfo class.

Top

Properties

  Name Description
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 Attributes When called by trusted applications, gets or sets the FileAttributes of the current FileSystemInfo.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 CreationTime When called by trusted applications, gets or sets the creation time of the current FileSystemInfo object.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 Exists Gets a value indicating whether the file or directory exists.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 Extension Gets the string representing the extension part of the file.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 FullName When called by trusted applications, gets the full path of the directory or file.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 LastAccessTime When called by trusted applications, gets or sets the time the current file or directory was last accessed.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 LastWriteTime When called by trusted applications, gets or sets the time when the current file or directory was last written to.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360 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
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 Delete When called by trusted applications, deletes a file or directory.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 Equals(Object) Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 Finalize Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 GetType Gets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 Refresh Refreshes the state of the object.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360 ToString Returns a string that represents the current object. (Inherited from Object.)

Top

Fields

  Name Description
Protected fieldSupported by Silverlight for Windows PhoneSupported by Xbox 360 FullPath Infrastructure. Represents the fully qualified path of the directory or file.
Protected fieldSupported by Silverlight for Windows PhoneSupported by Xbox 360 OriginalPath Infrastructure. The path originally specified by the user, whether relative or absolute.

Top

Remarks

Platform Notes

Silverlight for Windows Phone Silverlight for Windows Phone

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

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

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.

See Also

Reference

Other Resources