Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

text read c#

// Example #1
// Read the file as one string.
string text = System.IO.File.ReadAllText(@"C:UsersPublicTestFolderWriteText.txt");

// Example #2
// Read each line of the file into a string array. Each element
// of the array is one line of the file.
string[] lines = System.IO.File.ReadAllLines(@"C:UsersPublicTestFolderWriteLines2.txt");
Comment

read text c#

var text = File.ReadAllText(file, Encoding.GetEncoding(codePage));

List of codepages : https://learn.microsoft.com/en-us/windows/win32/intl/code-page-identifiers?redirectedfrom=MSDN
Comment

PREVIOUS NEXT
Code Example
Csharp :: system.net.mail send html message 
Csharp :: c# array max 
Csharp :: c# combobox add item 
Csharp :: null check syntax c# 
Csharp :: unity set sprite image from script 
Csharp :: dictionary to list c# 
Csharp :: get unique array based on value in c# 
Csharp :: c# string ends with 
Csharp :: add row and columns to grid wpf in code 
Csharp :: how to get unique list in c# 
Csharp :: c# read large file 
Csharp :: how to minimum text length in textbox in c# 
Csharp :: c# code skripte kommunizieren 
Csharp :: map user to ConnectionId SignalR 
Csharp :: c# add 2 arrays 
Csharp :: make 2D object move at constant speed unity 
Csharp :: how to send button name for method in c# 
Csharp :: asp.net core 6 autofac 
Csharp :: how to show process time run c# 
Csharp :: c# Dictionary contains key case insensitive 
Csharp :: regex for accepting a file name c# 
Csharp :: singleton design pattern c# volatile 
Csharp :: how to display array in string in c# 
Csharp :: ignore ssl c# 
Csharp :: c# list add to list 
Csharp :: c# if isset 
Csharp :: cmd move directory to another directory 
Csharp :: how to return a value in c# 
Csharp :: how to add skybox in unity 
Csharp :: global exception handler c# 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =