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

Josip JuricPosted Sep 23, 2010, 11:26 AM EDT
This is good but TextReader had a better alternative StreamReader and you could dispose TextReader on the end! :)
Fareed NizamiPosted Sep 21, 2010, 10:30 PM EDT
Keep it up , nice ......
Fareed NizamiPosted Sep 21, 2010, 10:29 PM EDT
Nice one article, keep it up
R JPosted Sep 21, 2010, 2:57 AM EDT
hi... how to display the text of text-file into a richtext box in windows application....