.NET Framework Class Library
FileInfo Members

Updated: November 2007

Provides instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of FileStream objects. This class cannot be inherited.

The FileInfo type exposes the following members.

  NameDescription
FileInfo Initializes a new instance of the FileInfo class, which acts as a wrapper for a file path.
Top
  NameDescription
AppendText Creates a StreamWriter that appends text to the file represented by this instance of the FileInfo.
CopyToOverloaded. Copies an existing file to a new file.
Create Creates a file.
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.)
CreateText Creates a StreamWriter that writes a new text file.
Decrypt Decrypts a file that was encrypted by the current account using the Encrypt method.
Delete Permanently deletes a file. (Overrides FileSystemInfo..::.Delete()()().)
Encrypt Encrypts a file so that only the account used to encrypt the file can decrypt it.
Equals Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Finalize Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
GetAccessControlOverloaded. Gets a FileSecurity object that encapsulates the access control list (ACL) entries for the file described by the current FileInfo object.
GetHashCode Serves as a hash function for a particular type. (Inherited from Object.)
GetLifetimeService Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
GetObjectData Sets the SerializationInfo object with the file name and additional exception information. (Inherited from FileSystemInfo.)
GetType Gets the Type of the current instance. (Inherited from Object.)
InitializeLifetimeService Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)
MemberwiseCloneOverloaded.
MoveTo Moves a specified file to a new location, providing the option to specify a new file name.
OpenOverloaded. Opens a file with various read/write and sharing privileges.
OpenRead Creates a read-only FileStream.
OpenText Creates a StreamReader with UTF8 encoding that reads from an existing text file.
OpenWrite Creates a write-only FileStream.
Refresh Refreshes the state of the object. (Inherited from FileSystemInfo.)
ReplaceOverloaded. Replaces the contents of a specified file with the file described by the current FileInfo object, deleting the original file, and creating a backup of the replaced file.
SetAccessControl Applies access control list (ACL) entries described by a FileSecurity object to the file described by the current FileInfo object.
ToString Returns the path as a string. (Overrides Object..::.ToString()()().)
Top
  NameDescription
FullPath Represents the fully qualified path of the directory or file. (Inherited from FileSystemInfo.)
OriginalPath The path originally specified by the user, whether relative or absolute. (Inherited from FileSystemInfo.)
Top
  NameDescription
Attributes Gets or sets the FileAttributes of the current FileSystemInfo. (Inherited from FileSystemInfo.)
CreationTime Gets or sets the creation time of the current FileSystemInfo object. (Inherited from FileSystemInfo.)
CreationTimeUtc Gets or sets the creation time, in coordinated universal time (UTC), of the current FileSystemInfo object. (Inherited from FileSystemInfo.)
Directory Gets an instance of the parent directory.
DirectoryName Gets a string representing the directory's full path.
Exists Gets a value indicating whether a file exists. (Overrides FileSystemInfo..::.Exists.)
Extension Gets the string representing the extension part of the file. (Inherited from FileSystemInfo.)
FullName Gets the full path of the directory or file. (Inherited from FileSystemInfo.)
IsReadOnly Gets or sets a value that determines if the current file is read only.
LastAccessTime Gets or sets the time the current file or directory was last accessed. (Inherited from FileSystemInfo.)
LastAccessTimeUtc Gets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed. (Inherited from FileSystemInfo.)
LastWriteTime Gets or sets the time when the current file or directory was last written to. (Inherited from FileSystemInfo.)
LastWriteTimeUtc Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to. (Inherited from FileSystemInfo.)
Length Gets the size, in bytes, of the current file.
Name Gets the name of the file. (Overrides FileSystemInfo..::.Name.)
Top
Page view tracker