How to read and Write the Text file from Console App [Resolved]

Posted by Self-Innovator under C# on 4/12/2012 | Points: 10 | Views : 14783 | Status : [Member] | Replies : 11
Hi friends...
pls find me the solution with good ex....to read and write the .txt file from Console App using C#

Join Hands Change lives
Thanks & Regards
Straight Edge Society



Responses

Posted by: Sakthi.Singaravel on: 4/12/2012 [Member] Silver | Points: 50

Up
0
Down

Resolved
Hi,

The following is simple txt file writing and reading...

using System.IO;

static class Module1
{

public static void Main()
{
StreamWriter wr = new StreamWriter("E:\\ss.txt");
wr.WriteLine("Writing text into txt file");
wr.Close();
StreamReader reader = new StreamReader("e:\\ss.txt");
string strRead = reader.ReadToEnd();
reader.Close();
Console.WriteLine(strRead);
Console.Read();
}

}


Regards,
Singaravel M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/12/2012 [Member] Silver | Points: 25

Up
0
Down
Hi,

r u got solution...?

Regards,
Singaravel M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/12/2012 [Member] Silver | Points: 25

Up
0
Down
is it working...?

Regards,
Singaravel M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/12/2012 [Member] Silver | Points: 25

Up
0
Down
hi self-innovator,

r u got solution for this...

plz reply ur feedback....!!!!!!!!

Regards,
Singaravel M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/12/2012 [Member] Bronze | Points: 25

Up
0
Down
Refer This

http://www.dotnetfunda.com/codes/code2277-reading-text-data-from-a-file-in-csharp.aspx


Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 4/12/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi Refer This
http://www.dotnetfunda.com/codes/code2276-writing-text-data-to-a-file-in-csharp.aspx

Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/13/2012 [Member] Silver | Points: 25

Up
0
Down
hello,
if u got solution or not
giv ur feedback..

Regards,
Singaravel M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/13/2012 [Member] Silver | Points: 25

Up
0
Down
i m expect ur valuable feedback..

Regards,
Singaravel M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-Innovator on: 4/13/2012 [Member] Bronze | Points: 25

Up
0
Down
S thanks Sakthi....

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sakthi.Singaravel on: 4/13/2012 [Member] Silver | Points: 25

Up
0
Down
its okay...


Regards,
Singaravel M

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Self-Innovator on: 4/13/2012 [Member] Bronze | Points: 25

Up
0
Down
Users may be busy sometimes right......

Join Hands Change lives
Thanks & Regards
Straight Edge Society

Self-Innovator, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response