Hello.I want to edit a txt file in c:\windows but I can't...I'm using this code:
StreamWriter sw = new StreamWriter(@"c:\windows\zamma\zamma.txt");
sw.Write(textBox3.Text);
sw.Close();
What's wrong whit my code? Thanks in advance....
(sorry for my Englisch...)
Loading


Tanmay SarkarRank #1,407 · 1.2K reputationPosted Oct 30, 2010, 10:45 PM EDT
Thank you!
Abdullah AKALIN30 reputationPosted Oct 31, 2010, 6:16 AM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Oct 31, 2010, 2:44 PM EDT
Abdullah AKALIN30 reputationPosted Nov 5, 2010, 9:59 AM EDT
Thank you for your reply.But there isn't an error message or anything like it.I press to F5 to run my program,and edit the text,then press to my"save"button.But nothing changes in the text file...I wish,I could explain my problem.
Sam HobbsRank #107 · 20.5K reputationPosted Nov 5, 2010, 10:57 AM EDT
Abdullah AKALIN30 reputationPosted Nov 5, 2010, 12:22 PM EDT
JureRank #2,128 · 670 reputationPosted Nov 5, 2010, 3:10 PM EDT
Maybe your save button isn't programmed correctly? The code you posted is OK, that's why I ask.
Sam HobbsRank #107 · 20.5K reputationPosted Nov 5, 2010, 6:43 PM EDT
Something else to do is to use a try/catch block to catch errors. There might be an error happening that you don't see.