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

 
Best quality Asp .Net Ajax Control Toolkit tutorials.

Give your valuable comments.

Name
Email
Comment
3 + 6 =
 

About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2024 CodingFusion
50+ C# Programs for beginners to practice