This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
File Methods
The methods of the File class are listed below. For a complete list of File class members, see the File Members topic.
Public:
AppendText |
Overloaded. Creates a StreamWriter that appends text to a file. |
ChangeExtension |
Changes a file extension. |
Copy |
Overloaded. Copies an existing file to a new file. |
CopyTo |
Overloaded. Copies an existing file to a new file. |
Create |
Overloaded. Creates a file in the specified path. |
CreateText |
Overloaded. Creates a StreamWriter that writes a new text file. |
Delete |
Overloaded. Deletes a file. |
Equals (inherited from Object) |
Determines whether the specified Object is the same instance as the current Object. Subclasses are expected to override this method to support value equality (not reference equality). |
FileExists |
Determines whether a file exists on the specified path. |
GetDirectoryNameFromPath |
Returns the directory path of a file. |
GetExtension |
Returns the extension of the specified path. |
GetFileNameFromPath |
Returns the name and extension parts of the given path. |
GetHashCode (inherited from Object) |
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. |
GetTempFileName |
Returns a unique temporary file name and creates a 0-byte file by that name on disk. |
GetType (inherited from Object) |
Gets the Type of the Object. |
HasExtension |
Determines whether a path includes a file extension. |
Move |
Moves a specified file to a new location and potentially a new file name. This method does work across volumes. |
MoveTo |
Moves a given file to a new location and potentially a new file name. This method works across volumes. |
Open |
Overloaded. Opens a file with various read-write and sharing privileges. |
OpenRead |
Overloaded. Creates a read-only Stream around a file.. |
OpenText |
Overloaded. Creates a StreamReader that reads from an existing text file. |
OpenWrite |
Overloaded. Creates a read-write Stream. |
Refresh |
Refreshes the state of the object. |
ToString |
Returns the fully qualified path. |
Protected:
Finalize (inherited from Object) |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by the Garbage Collector (GC). This method may be ignored by the runtime; therefore, necessary cleanup operations should be done elsewhere. |
MemberwiseClone (inherited from Object) |
Creates a shallow copy of the current Object. |
See Also
File Class | System.IO Namespace