Blog

How to read text from notepad?

By Owais Khan Blogs | Files, Directory, IO Sep 21, 2010
How to read text from notepad in C#.
Download Files: how to open text.zip

This code snippet demonstrates how to read a text file and write text on a console.

using
System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.IO;

 

namespace convert_string_to_binery

{

    class Program

    {

        static void Main(string[] args)

        {

            TextReader tr = File.OpenText(@"E:\c#\ssdd.txt");

            Console.WriteLine(tr.ReadToEnd());

            tr.Close();

            Console.WriteLine(Console.Read());

        }

    }

}

COMMENT USING