1
Reply

How to read word file line by line in C#.

Mahesh Kumar

Mahesh Kumar

Dec 23, 2010
9.6k
0

    static void Main(string[] args)
            {
                string _line;
                string _path = @"C:\Users\sude\Documents\username.txt";
                StreamReader _reader = new StreamReader(_path);
                
                while((_line = _reader.ReadLine())!=null)
                {
                    Console.WriteLine(_line);
                }
            }

    Subhendu De
    December 28, 2010
    0