c# get string from file code example Example: c# read file into a string string mystring = File.ReadAllText(your_file_location, Encoding.UTF8);