C# Program to read the content of a file

In this C# program, we will read the content of the Text file and print the content of the file.

C# Program to read the content of a file Code:

private static void Main(string[] args)
        {
            string contents = File.ReadAllText(@"C:\Temp.txt");
            Console.Write("Output: "+contents);
            Console.ReadLine();
        }

C# Program to read the content of a file Output:

CSharp-program-to-read-the-content-of-a-file

 
We are nothing without our users ! You can help us offer even more high quality content. Please share our page !
Best quality Asp .Net Ajax Control Toolkit tutorials.

Give your valuable comments.

Name
Email
Comment
2 + 2 =
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2022 CodingFusion
75 Important SQL Server queries you should know