Blog

How to read text from notepad?

Posted by Owais Khan Blogs | Files, Directory, IO Sep 21, 2010
How to read text from notepad in C#.

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
PREMIUM SPONSORS
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.
SPONSORED BY
  • MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.