How to read text file to string c#

 How to read text file to string c#


C# code


    namespace htmlspacecode
    {
        class Program
        {
            static void Main(string[] args)
            {
                string helloText = System.IO.File.ReadAllText("hello.txt");
                System.Console.WriteLine(helloText);
            }
        }
    }

Result






Reactions

Post a Comment

0 Comments