Author: Visual Web Developer | Posted on: 8/23/2009 4:11:28 PM | Views : 242

 I have a TextBox on the form where it is possible to write a "String". Now when I exectute this code, I am trying to write
this String to a file. However this string isn´t written to the File. I am not sure if I am missing something out with the postback here in order to do it correctly.
 
String Path1 = Server.MapPath("~/Folder1/File1.txt"); System.IO.FileStream ud1 = new System.IO.FileStream(Path1, System.IO.FileMode.Open, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite); System.IO.StreamWriter Write1 = new System.IO.StreamWriter(ud1); Write1.WriteLine(<strong> + TextBox1.Text.Trim() + </strong>); Write1.Close(); ud1.Close();
 
...

Go to the complete details ...