1
Reply

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

Mahesh Kumar

Mahesh Kumar

13y
9.6k
0
Reply

    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);
                }
            }