Метод | Описание | |
---|---|---|
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. |
Метод | Описание | |
---|---|---|
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 |
|
Результат | void |
public AppendAllLines ( string path, IEnumerable |
||
path | string | |
contents | IEnumerable |
|
encoding | ||
Результат | void |
public AppendAllText ( string path, string contents ) : void | ||
path | string | |
contents | string | |
Результат | void |
public AppendAllText ( string path, string contents, |
||
path | string | |
contents | string | |
encoding | ||
Результат | void |
public AppendText ( string path ) : StreamWriter | ||
path | string | |
Результат | StreamWriter |
public Copy ( string sourceFileName, string destFileName ) : void | ||
sourceFileName | string | |
destFileName | string | |
Результат | void |
public Copy ( string sourceFileName, string destFileName, bool overwrite ) : void | ||
sourceFileName | string | |
destFileName | string | |
overwrite | bool | |
Результат | void |
public Create ( string path, int bufferSize ) : Stream | ||
path | string | |
bufferSize | int | |
Результат | Stream |
public Create ( string path, int bufferSize, FileOptions options ) : Stream | ||
path | string | |
bufferSize | int | |
options | FileOptions | |
Результат | Stream |
public Create ( string path, int bufferSize, FileOptions options, |
||
path | string | |
bufferSize | int | |
options | FileOptions | |
fileSecurity | ||
Результат | Stream |
public CreateText ( string path ) : StreamWriter | ||
path | string | |
Результат | StreamWriter |
public GetAccessControl ( string path ) : |
||
path | string | |
Результат |
public GetAccessControl ( string path, AccessControlSections includeSections ) : |
||
path | string | |
includeSections | AccessControlSections | |
Результат |
public GetAttributes ( string path ) : FileAttributes | ||
path | string | The path to the file. |
Результат | FileAttributes |
public GetCreationTime ( string path ) : DateTime | ||
path | string | |
Результат | DateTime |
public GetCreationTimeUtc ( string path ) : DateTime | ||
path | string | |
Результат | DateTime |
public GetLastAccessTime ( string path ) : DateTime | ||
path | string | |
Результат | DateTime |
public GetLastAccessTimeUtc ( string path ) : DateTime | ||
path | string | |
Результат | DateTime |
public GetLastWriteTime ( string path ) : DateTime | ||
path | string | |
Результат | DateTime |
public GetLastWriteTimeUtc ( string path ) : DateTime | ||
path | string | |
Результат | DateTime |
public MockFile ( IMockFileDataAccessor mockFileDataAccessor ) : System.Collections.Generic | ||
mockFileDataAccessor | IMockFileDataAccessor | |
Результат | System.Collections.Generic |
public Move ( string sourceFileName, string destFileName ) : void | ||
sourceFileName | string | |
destFileName | string | |
Результат | void |
public Open ( string path, FileMode mode ) : Stream | ||
path | string | |
mode | FileMode | |
Результат | Stream |
public Open ( string path, FileMode mode, FileAccess access ) : Stream | ||
path | string | |
mode | FileMode | |
access | FileAccess | |
Результат | Stream |
public Open ( string path, FileMode mode, FileAccess access, FileShare share ) : Stream | ||
path | string | |
mode | FileMode | |
access | FileAccess | |
share | FileShare | |
Результат | Stream |
public OpenText ( string path ) : StreamReader | ||
path | string | |
Результат | StreamReader |
public ReadAllBytes ( string path ) : byte[] | ||
path | string | |
Результат | byte[] |
public ReadAllLines ( string path ) : string[] | ||
path | string | |
Результат | string[] |
public ReadAllLines ( string path, |
||
path | string | |
encoding | ||
Результат | string[] |
public ReadAllText ( string path ) : string | ||
path | string | |
Результат | string |
public ReadAllText ( string path, |
||
path | string | |
encoding | ||
Результат | string |
public ReadLines ( string path ) : IEnumerable |
||
path | string | |
Результат | IEnumerable |
public ReadLines ( string path, |
||
path | string | |
encoding | ||
Результат | IEnumerable |
public Replace ( string sourceFileName, string destinationFileName, string destinationBackupFileName ) : void | ||
sourceFileName | string | |
destinationFileName | string | |
destinationBackupFileName | string | |
Результат | void |
public Replace ( string sourceFileName, string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors ) : void | ||
sourceFileName | string | |
destinationFileName | string | |
destinationBackupFileName | string | |
ignoreMetadataErrors | bool | |
Результат | void |
public SetAccessControl ( string path, |
||
path | string | |
fileSecurity | ||
Результат | void |
public SetAttributes ( string path, FileAttributes fileAttributes ) : void | ||
path | string | |
fileAttributes | FileAttributes | |
Результат | void |
public SetCreationTime ( string path, DateTime creationTime ) : void | ||
path | string | |
creationTime | DateTime | |
Результат | void |
public SetCreationTimeUtc ( string path, DateTime creationTimeUtc ) : void | ||
path | string | |
creationTimeUtc | DateTime | |
Результат | void |
public SetLastAccessTime ( string path, DateTime lastAccessTime ) : void | ||
path | string | |
lastAccessTime | DateTime | |
Результат | void |
public SetLastAccessTimeUtc ( string path, DateTime lastAccessTimeUtc ) : void | ||
path | string | |
lastAccessTimeUtc | DateTime | |
Результат | void |
public SetLastWriteTime ( string path, DateTime lastWriteTime ) : void | ||
path | string | |
lastWriteTime | DateTime | |
Результат | void |
public SetLastWriteTimeUtc ( string path, DateTime lastWriteTimeUtc ) : void | ||
path | string | |
lastWriteTimeUtc | DateTime | |
Результат | void |
public WriteAllBytes ( string path, byte bytes ) : void | ||
path | string | The file to write to. |
bytes | byte | The bytes to write to the file. |
Результат | void |
public WriteAllLines ( string path, IEnumerable |
||
path | string | The file to write to. |
contents | IEnumerable |
The lines to write to the file. |
Результат | 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. | |
Результат | 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. |
Результат | 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 |
|
Результат | void |
public WriteAllText ( string path, string contents ) : void | ||
path | string | The file to write to. |
contents | string | The string to write to the file. |
Результат | 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. | |
Результат | void |