The File type exposes the following members.
Back to Top
Back to Top
Back to Top
Constructors
Name | Description | |
---|---|---|
File |
Methods
Name | Description | |
---|---|---|
AppendAllText(String, String) |
Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
(Overrides AbstractFile AppendAllText(String, String).) | |
AppendAllText(String, String, Encoding) |
Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
(Overrides AbstractFile AppendAllText(String, String, Encoding).) | |
Copy(String, String) |
Copies an existing file to a new file. Overwriting a file of the same name is not allowed.
(Overrides AbstractFile Copy(String, String).) | |
Copy(String, String, Boolean) |
Copies an existing file to a new file. Overwriting a file of the same name is allowed.
(Overrides AbstractFile Copy(String, String, Boolean).) | |
Create |
Creates or overwrites a file in the specified path.
(Overrides AbstractFile Create(String).) | |
CreateText |
Creates or overwrites a file for writing UTF-8 encoded text.
(Overrides AbstractFile CreateText(String).) | |
Delete |
Deletes the specified file. An exception is not thrown if the specified file does not exist.
(Overrides AbstractFile Delete(String).) | |
Equals | (Inherited from Object.) | |
Exists |
Determines whether the specified file exists.
(Overrides AbstractFile Exists(String).) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetAccessControl |
Gets a FileSecurity object that encapsulates the access control list (ACL) entries for a specified directory.
(Overrides AbstractFile GetAccessControl(String).) | |
GetFileUrl |
Returns URL to file. If can be accessed directly then direct URL is generated else URL with GetFile page is generated.
(Overrides AbstractFile GetFileUrl(String, String).) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetLastWriteTime |
Returns the date and time the specified file or directory was last written to.
(Overrides AbstractFile GetLastWriteTime(String).) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Move |
Moves a specified file to a new location, providing the option to specify a new file name.
(Overrides AbstractFile Move(String, String).) | |
Open |
Opens a FileStream on the specified path, with the specified mode and access.
(Overrides AbstractFile Open(String, FileMode, FileAccess).) | |
OpenRead |
Opens an existing file for reading.
(Overrides AbstractFile OpenRead(String).) | |
OpenText |
Opens an existing UTF-8 encoded text file for reading.
(Overrides AbstractFile OpenText(String).) | |
ReadAllBytes |
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
(Overrides AbstractFile ReadAllBytes(String).) | |
ReadAllText(String) |
Opens a text file, reads all lines of the file, and then closes the file.
(Overrides AbstractFile ReadAllText(String).) | |
ReadAllText(String, Encoding) |
Opens a text file, reads all lines of the file, and then closes the file.
(Overrides AbstractFile ReadAllText(String, Encoding).) | |
SetAttributes |
Sets the specified FileAttributes of the file on the specified path.
(Overrides AbstractFile SetAttributes(String, FileAttributes).) | |
SetLastWriteTime |
Sets the date and time that the specified file was last written to.
(Overrides AbstractFile SetLastWriteTime(String, DateTime).) | |
SetLastWriteTimeUtc |
Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
(Overrides AbstractFile SetLastWriteTimeUtc(String, DateTime).) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
WriteAllBytes |
Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.
(Overrides AbstractFile WriteAllBytes(String, Byte ).) | |
WriteAllText(String, String) |
Creates a new file, write the contents to the file, and then closes the file. If the target file already exists, it is overwritten.
(Overrides AbstractFile WriteAllText(String, String).) | |
WriteAllText(String, String, Encoding) |
Creates a new file, write the contents to the file, and then closes the file. If the target file already exists, it is overwritten.
(Overrides AbstractFile WriteAllText(String, String, Encoding).) |
Extension Methods
Name | Description | |
---|---|---|
AsValue |
Converts object to a query value which can be used as a query parameter
(Defined by QueryExtensions.) | |
GetAPIString |
Gets the string by the specified resource key
(Defined by CoreExtensions.) | |
GetString |
Gets the string by the specified resource key
(Defined by CoreExtensions.) | |
ToBoolean |
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.) | |
ToDateTime |
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.) | |
ToDouble |
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.) | |
ToGuid |
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.) | |
ToInteger |
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.) | |
ToString |
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.) |
See Also