Horje
read file c# Code Example
c sharp how to read a text file
// To save the text as one string use 'ReadAllText()'
string text = System.IO.File.ReadAllText(@"C:\filepath\file.txt");
// To save each line seperately in an array use 'ReadAllLines()'
string[] lines = System.IO.File.ReadAllLines(@"C:\filepath\file.txt");
read file c#
string text = File.ReadAllText(@"c:\file.txt", Encoding.UTF8);
c# read all text from a file
using (StreamReader streamReader = new StreamReader(path_name, Encoding.UTF8))
{
  contents = streamReader.ReadToEnd();
}
c# read from file
string[] lines = File.ReadAllLines(@"c:\file.txt", Encoding.UTF8);
read file c#

string contents = File.ReadAllText(@"C:\temp\test.txt");

how to read a text file C#
string[] text = System.IO.File.ReadAllLines(@"C:\users\username\filepath\file.txt");




Csharp

Related
c# exit console Code Example c# exit console Code Example
insert variables into string c# Code Example insert variables into string c# Code Example
unity how to set an objects postion x,y,z Code Example unity how to set an objects postion x,y,z Code Example
unity run void from another script Code Example unity run void from another script Code Example
c# MessageBox Code Example c# MessageBox Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10