read text file to string csharp

Code Example - read text file to string csharp

                
                        string mystring = System.IO.File.ReadAllText(@"C:\Users\Public\TestFolder\WriteText.txt");
                    
                
 

csharp read file into a string

                        
                                string mystring = File.ReadAllText(your_file_location, Encoding.UTF8);
                            
                        
 

Related code examples