how to read a text file in c# Class file

Posted by Sripriya under C# on 8/3/2011 | Points: 10 | Views : 1351 | Status : [Member] | Replies : 3
how to read a text file in c# Class file give sample coding




Responses

Posted by: Jpchoudhari on: 8/3/2011 [Member] Starter | Points: 25

Up
0
Down
refer http://support.microsoft.com/kb/816149
http://www.csharp-station.com/HowTo/ReadWriteTextFile.aspx

Kind Regards,
Jay

Sripriya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 8/3/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
It is simple, here is two articles from from this website

http://www.dotnetfunda.com/articles/article548-common-operation-with-files-and-folders-in-aspnet-.aspx
http://www.dotnetfunda.com/articles/article1226-working-with-files-and-directories-part-2-.aspx

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Sripriya, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 8/3/2011 [Member] Bronze | Points: 25

Up
0
Down
Here is the code to read text files:

string strFilePath = "<your-txt-file-path>";
IO.StreamReader reader = new IO.StreamReader(strFilePath);
strign output = reader.ReadToEnd();

Hope this will help you

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Sripriya, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response