LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Blogs > sanju1186
User Name
Password

Notices


Rate this Entry

coding of the week

Posted 08-19-2008 at 05:51 AM by sanju1186

using System;
using System.IO;
class FileRead
{
public static void ReadData()
{
FileStream fs = new FileStream("test.txt", FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
sr.BaseStream.Seek(0, SeekOrigin.Begin);
string str = sr.ReadLine();
while (str != null)
{
Console.WriteLine(str);
str = sr.ReadLine();
}
sr.Close();
fs.Close();

}
public static void Main()
{
ReadData();
}
}
Posted in Uncategorized
Views 606 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 07:35 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration