Export (0) Print
Expand All

FileInfo Methods

The FileInfo type exposes the following members.

  Name Description
Public method AppendText Creates a StreamWriter that appends text to the file represented by this instance of the FileInfo.
Public method CopyTo(String) Copies an existing file to a new file, disallowing the overwriting of an existing file.
Public method CopyTo(String, Boolean) Copies an existing file to a new file, allowing the overwriting of an existing file.
Public method Create Creates a file.
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 CreateText Creates a StreamWriter that writes a new text file.
Public method Decrypt Decrypts a file that was encrypted by the current account using the Encrypt method.
Public method Delete Permanently deletes a file. (Overrides FileSystemInfo.Delete().)
Public method Encrypt Encrypts a file so that only the account used to encrypt the file can decrypt it.
Public method Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method GetAccessControl() Gets a FileSecurity object that encapsulates the access control list (ACL) entries for the file described by the current FileInfo object.
Public method GetAccessControl(AccessControlSections) Gets a FileSecurity object that encapsulates the specified type of access control list (ACL) entries for the file described by the current FileInfo object.
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 specified file to a new location, providing the option to specify a new file name.
Public method Open(FileMode) Opens a file in the specified mode.
Public method Open(FileMode, FileAccess) Opens a file in the specified mode with read, write, or read/write access.
Public method Open(FileMode, FileAccess, FileShare) Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.
Public method OpenRead Creates a read-only FileStream.
Public method OpenText Creates a StreamReader with UTF8 encoding that reads from an existing text file.
Public method OpenWrite Creates a write-only FileStream.
Public method Refresh Refreshes the state of the object. (Inherited from FileSystemInfo.)
Public method Replace(String, String) 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.
Public method Replace(String, String, Boolean) 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. Also specifies whether to ignore merge errors.
Public method SetAccessControl Applies access control list (ACL) entries described by a FileSecurity object to the file described by the current FileInfo object.
Public method ToString Returns the path as a string. (Overrides Object.ToString().)
Top
Show:
© 2014 Microsoft