LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 983 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 05:41 PM.

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
Open Source Consulting | Domain Registration