Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c sharp how to read a text file

// To save the text as one string use 'ReadAllText()'
string text = System.IO.File.ReadAllText(@"C:filepathfile.txt");
// To save each line seperately in an array use 'ReadAllLines()'
string[] lines = System.IO.File.ReadAllLines(@"C:filepathfile.txt");
Comment

c# read all text from a file

using (StreamReader streamReader = new StreamReader(path_name, Encoding.UTF8))
{
  contents = streamReader.ReadToEnd();
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: how to cast list to observablecollection c# 
Csharp :: wpf image clip with rounded corners 
Csharp :: text not centered winforms button 
Csharp :: C# multiple button click event to password textbox 
Csharp :: snx disconnect linux 
Csharp :: convert int array to string in C# 
Csharp :: convert request.form to dictionary c# 
Csharp :: reference to another script unity 
Csharp :: which gas is at anode 
Csharp :: unity how to get fps c# 
Csharp :: c# regex number only 
Csharp :: revitapi 
Csharp :: c# file exist 
Csharp :: uuid generator asp.net 
Csharp :: object list to csv c# 
Csharp :: renaming table name entity framework code first fluent api 
Csharp :: get enum int by name 
Csharp :: how create another new app file in laravel 
Csharp :: how refresh just one table in laravel by terminal 
Csharp :: destroy gameobject unity 
Csharp :: c sharp if string equals 
Csharp :: formula text and/or netsuite 
Csharp :: c# connect to mongodb 
Csharp :: asp net bootstrap 5 navigation bar 
Csharp :: bootrap modal 
Csharp :: how to execute linux command from c# 
Csharp :: Comapre Binary Trees 
Csharp :: c# generate random number 
Csharp :: jarray to list c# 
Csharp :: how to run code without a gameobject unity 
ADD CONTENT
Topic
Content
Source link
Name
3+1 =