Click or drag to resize

FileInfo Methods

The FileInfo type exposes the following members.

Methods
 NameDescription
Public methodCode exampleAppendText Creates a StreamWriter that appends text to the file represented by this instance of the FileInfo.
Public methodCopyTo(String) Copies the specified file to a new file location.
Public methodCopyTo(String, Boolean) Copies the specified file to a new file location with the option to overwrite.
Public methodCode exampleCreate Creates a file.
Public methodCode exampleCreateText Creates a StreamWriter that writes a new text file.
Public methodDelete Delete the file.
(Overrides FileSystemInfoDelete)
Public methodEqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
Public methodGetHashCodeServes as the default hash function.
(Inherited from Object)
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodMoveTo Moves the specified file to the destination with possibly a new file name.
Public methodCode exampleOpen(FileMode) Opens a file in the specified mode.
Public methodOpen(FileMode, FileAccess) Opens the current file with the specified mode and access.
Public methodOpen(FileMode, FileAccess, FileShare) Opens a file in the specified mode with read, write, or read/write access and the specified sharing option.
Public methodOpenRead Opens the current file with Read only access.
Public methodCode exampleOpenText Creates a StreamReader with UTF8 encoding that reads from an existing text file.
Public methodOpenWrite Opens the current file with write only access.
Public methodRefresh Refreshes the state of the object.
(Overrides FileSystemInfoRefresh)
Public methodToStringReturns a string that represents the current object.
(Inherited from Object)
Top
See Also