[]
Opens a text file, reads all lines of the file, and then closes the file.
public static string ReadAllText(string path)
Type | Name | Description |
---|---|---|
string | path | The file to open for reading. |
Type | Description |
---|---|
string | A string containing all lines of the file. |
Opens a text file, reads all lines of the file, and then closes the file.
public static string ReadAllText(string path, Encoding encoding, NativeFileShare sharing = NativeFileShare.Read)
Type | Name | Description |
---|---|---|
string | path | The file to open for reading. |
Encoding | encoding | The encoding. |
NativeFileShare | sharing | The sharing. |
Type | Description |
---|---|
string | A string containing all lines of the file. |