Method | Description | |
---|---|---|
AppendAllLines ( string path, IEnumerable |
||
AppendAllLines ( string path, IEnumerable |
||
AppendAllText ( string path, string contents ) : void | ||
AppendAllText ( string path, string contents, |
||
AppendText ( string path ) : StreamWriter | ||
Copy ( string sourceFileName, string destFileName ) : void | ||
Copy ( string sourceFileName, string destFileName, bool overwrite ) : void | ||
Create ( string path ) : Stream | ||
Create ( string path, int bufferSize ) : Stream | ||
Create ( string path, int bufferSize, FileOptions options ) : Stream | ||
Create ( string path, int bufferSize, FileOptions options, |
||
CreateText ( string path ) : StreamWriter | ||
Decrypt ( string path ) : void | ||
Delete ( string path ) : void | ||
Encrypt ( string path ) : void | ||
Exists ( string path ) : bool | ||
GetAccessControl ( string path ) : |
||
GetAccessControl ( string path, AccessControlSections includeSections ) : |
||
GetAttributes ( string path ) : FileAttributes |
Gets the FileAttributes of the file on the path.
|
|
GetCreationTime ( string path ) : DateTime | ||
GetCreationTimeUtc ( string path ) : DateTime | ||
GetLastAccessTime ( string path ) : DateTime | ||
GetLastAccessTimeUtc ( string path ) : DateTime | ||
GetLastWriteTime ( string path ) : DateTime | ||
GetLastWriteTimeUtc ( string path ) : DateTime | ||
MockFile ( IMockFileDataAccessor mockFileDataAccessor ) : System.Collections.Generic | ||
Move ( string sourceFileName, string destFileName ) : void | ||
Open ( string path, FileMode mode ) : Stream | ||
Open ( string path, FileMode mode, FileAccess access ) : Stream | ||
Open ( string path, FileMode mode, FileAccess access, FileShare share ) : Stream | ||
OpenRead ( string path ) : Stream | ||
OpenText ( string path ) : StreamReader | ||
OpenWrite ( string path ) : Stream | ||
ReadAllBytes ( string path ) : byte[] | ||
ReadAllLines ( string path ) : string[] | ||
ReadAllLines ( string path, |
||
ReadAllText ( string path ) : string | ||
ReadAllText ( string path, |
||
ReadLines ( string path ) : IEnumerable |
||
ReadLines ( string path, |
||
Replace ( string sourceFileName, string destinationFileName, string destinationBackupFileName ) : void | ||
Replace ( string sourceFileName, string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors ) : void | ||
SetAccessControl ( string path, |
||
SetAttributes ( string path, FileAttributes fileAttributes ) : void | ||
SetCreationTime ( string path, DateTime creationTime ) : void | ||
SetCreationTimeUtc ( string path, DateTime creationTimeUtc ) : void | ||
SetLastAccessTime ( string path, DateTime lastAccessTime ) : void | ||
SetLastAccessTimeUtc ( string path, DateTime lastAccessTimeUtc ) : void | ||
SetLastWriteTime ( string path, DateTime lastWriteTime ) : void | ||
SetLastWriteTimeUtc ( string path, DateTime lastWriteTimeUtc ) : void | ||
WriteAllBytes ( string path, byte bytes ) : void |
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. Given a byte array and a file path, this method opens the specified file, writes the contents of the byte array to the file, and then closes the file. |
|
WriteAllLines ( string path, IEnumerable |
Creates a new file, writes a collection of strings to the file, and then closes the file. If the target file already exists, it is overwritten. You can use this method to create the contents for a collection class that takes an IEnumerable{T} in its constructor, such as a List{T}, HashSet{T}, or a SortedSet{T} class. |
|
WriteAllLines ( string path, IEnumerable |
Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file. If the target file already exists, it is overwritten. You can use this method to create a file that contains the following: |
|
WriteAllLines ( string path, string contents ) : void |
Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file. If the target file already exists, it is overwritten. The default behavior of the WriteAllLines method is to write out data using UTF-8 encoding without a byte order mark (BOM). If it is necessary to include a UTF-8 identifier, such as a byte order mark, at the beginning of a file, use the FileBase.WriteAllLines(string,string[],System.Text.Encoding) method overload with UTF8Encoding encoding. Given a string array and a file path, this method opens the specified file, writes the string array to the file using the specified encoding, and then closes the file. |
|
WriteAllLines ( string path, string contents, |
Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file. If the target file already exists, it is overwritten. Given a string array and a file path, this method opens the specified file, writes the string array to the file using the specified encoding, and then closes the file. |
|
WriteAllText ( string path, string contents ) : void |
Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten. This method uses UTF-8 encoding without a Byte-Order Mark (BOM), so using the M:Encoding.GetPreamble method will return an empty byte array. If it is necessary to include a UTF-8 identifier, such as a byte order mark, at the beginning of a file, use the FileBase.WriteAllText(string,string,System.Text.Encoding) method overload with UTF8Encoding encoding. Given a string and a file path, this method opens the specified file, writes the string to the file, and then closes the file. |
|
WriteAllText ( string path, string contents, |
Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten. Given a string and a file path, this method opens the specified file, writes the string to the file using the specified encoding, and then closes the file. The file handle is guaranteed to be closed by this method, even if exceptions are raised. |
Method | Description | |
---|---|---|
GetTimeFromFile ( string path, DateTime>.Func |
||
ReadAllBytes ( byte contents, |
||
ReadAllTextInternal ( string path, |
||
VerifyDirectoryExists ( string path ) : void | ||
VerifyValueIsNotNull ( object value, string parameterName ) : void |
public AppendAllLines ( string path, IEnumerable |
||
path | string | |
contents | IEnumerable |
|
return | void |
public AppendAllLines ( string path, IEnumerable |
||
path | string | |
contents | IEnumerable |
|
encoding | ||
return | void |
public AppendAllText ( string path, string contents ) : void | ||
path | string | |
contents | string | |
return | void |
public AppendAllText ( string path, string contents, |
||
path | string | |
contents | string | |
encoding | ||
return | void |
public AppendText ( string path ) : StreamWriter | ||
path | string | |
return | StreamWriter |
public Copy ( string sourceFileName, string destFileName ) : void | ||
sourceFileName | string | |
destFileName | string | |
return | void |
public Copy ( string sourceFileName, string destFileName, bool overwrite ) : void | ||
sourceFileName | string | |
destFileName | string | |
overwrite | bool | |
return | void |
public Create ( string path, int bufferSize ) : Stream | ||
path | string | |
bufferSize | int | |
return | Stream |
public Create ( string path, int bufferSize, FileOptions options ) : Stream | ||
path | string | |
bufferSize | int | |
options | FileOptions | |
return | Stream |
public Create ( string path, int bufferSize, FileOptions options, |
||
path | string | |
bufferSize | int | |
options | FileOptions | |
fileSecurity | ||
return | Stream |
public CreateText ( string path ) : StreamWriter | ||
path | string | |
return | StreamWriter |
public GetAccessControl ( string path ) : |
||
path | string | |
return |
public GetAccessControl ( string path, AccessControlSections includeSections ) : |
||
path | string | |
includeSections | AccessControlSections | |
return |
public GetAttributes ( string path ) : FileAttributes | ||
path | string | The path to the file. |
return | FileAttributes |
public GetCreationTime ( string path ) : DateTime | ||
path | string | |
return | DateTime |
public GetCreationTimeUtc ( string path ) : DateTime | ||
path | string | |
return | DateTime |
public GetLastAccessTime ( string path ) : DateTime | ||
path | string | |
return | DateTime |
public GetLastAccessTimeUtc ( string path ) : DateTime | ||
path | string | |
return | DateTime |
public GetLastWriteTime ( string path ) : DateTime | ||
path | string | |
return | DateTime |
public GetLastWriteTimeUtc ( string path ) : DateTime | ||
path | string | |
return | DateTime |
public MockFile ( IMockFileDataAccessor mockFileDataAccessor ) : System.Collections.Generic | ||
mockFileDataAccessor | IMockFileDataAccessor | |
return | System.Collections.Generic |
public Move ( string sourceFileName, string destFileName ) : void | ||
sourceFileName | string | |
destFileName | string | |
return | void |
public Open ( string path, FileMode mode ) : Stream | ||
path | string | |
mode | FileMode | |
return | Stream |
public Open ( string path, FileMode mode, FileAccess access ) : Stream | ||
path | string | |
mode | FileMode | |
access | FileAccess | |
return | Stream |
public Open ( string path, FileMode mode, FileAccess access, FileShare share ) : Stream | ||
path | string | |
mode | FileMode | |
access | FileAccess | |
share | FileShare | |
return | Stream |
public OpenText ( string path ) : StreamReader | ||
path | string | |
return | StreamReader |
public ReadAllLines ( string path ) : string[] | ||
path | string | |
return | string[] |
public ReadAllLines ( string path, |
||
path | string | |
encoding | ||
return | string[] |
public ReadAllText ( string path, |
||
path | string | |
encoding | ||
return | string |
public ReadLines ( string path ) : IEnumerable |
||
path | string | |
return | IEnumerable |
public ReadLines ( string path, |
||
path | string | |
encoding | ||
return | IEnumerable |
public Replace ( string sourceFileName, string destinationFileName, string destinationBackupFileName ) : void | ||
sourceFileName | string | |
destinationFileName | string | |
destinationBackupFileName | string | |
return | void |
public Replace ( string sourceFileName, string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors ) : void | ||
sourceFileName | string | |
destinationFileName | string | |
destinationBackupFileName | string | |
ignoreMetadataErrors | bool | |
return | void |
public SetAccessControl ( string path, |
||
path | string | |
fileSecurity | ||
return | void |
public SetAttributes ( string path, FileAttributes fileAttributes ) : void | ||
path | string | |
fileAttributes | FileAttributes | |
return | void |
public SetCreationTime ( string path, DateTime creationTime ) : void | ||
path | string | |
creationTime | DateTime | |
return | void |
public SetCreationTimeUtc ( string path, DateTime creationTimeUtc ) : void | ||
path | string | |
creationTimeUtc | DateTime | |
return | void |
public SetLastAccessTime ( string path, DateTime lastAccessTime ) : void | ||
path | string | |
lastAccessTime | DateTime | |
return | void |
public SetLastAccessTimeUtc ( string path, DateTime lastAccessTimeUtc ) : void | ||
path | string | |
lastAccessTimeUtc | DateTime | |
return | void |
public SetLastWriteTime ( string path, DateTime lastWriteTime ) : void | ||
path | string | |
lastWriteTime | DateTime | |
return | void |
public SetLastWriteTimeUtc ( string path, DateTime lastWriteTimeUtc ) : void | ||
path | string | |
lastWriteTimeUtc | DateTime | |
return | void |
public WriteAllBytes ( string path, byte bytes ) : void | ||
path | string | The file to write to. |
bytes | byte | The bytes to write to the file. |
return | void |
public WriteAllLines ( string path, IEnumerable |
||
path | string | The file to write to. |
contents | IEnumerable |
The lines to write to the file. |
return | void |
public WriteAllLines ( string path, IEnumerable |
||
path | string | The file to write to. |
contents | IEnumerable |
The lines to write to the file. |
encoding | The character encoding to use. | |
return | void |
public WriteAllLines ( string path, string contents ) : void | ||
path | string | The file to write to. |
contents | string | The string array to write to the file. |
return | void |
public WriteAllLines ( string path, string contents, |
||
path | string | The file to write to. |
contents | string | The string array to write to the file. |
encoding | An |
|
return | void |
public WriteAllText ( string path, string contents ) : void | ||
path | string | The file to write to. |
contents | string | The string to write to the file. |
return | void |
public WriteAllText ( string path, string contents, |
||
path | string | The file to write to. |
contents | string | The string to write to the file. |
encoding | The encoding to apply to the string. | |
return | void |