RosettaCodeData/Task/Read-entire-file/C-sharp/read-entire-file.cs
2023-07-01 13:44:08 -04:00

10 lines
281 B
C#

using System.IO;
class Program
{
static void Main(string[] args)
{
var fileContents = File.ReadAllText("c:\\autoexec.bat");
// Can optionally take a second parameter to specify the encoding, e.g. File.ReadAllText("c:\\autoexec.bat", Encoding.UTF8)
}
}