hi im working on an window application form in which i have to save the data in text file which should contains the data the user would write in the richtextbox in that form......
A:
This could be of some help.
Simple Text File Operations in C#. and how to use Open and Save As Dialog Boxes
Shoban
2010-02-04 06:12:57
A:
you have one of 2 choices...
- create a file stream that simply writes the text out to a file:
- serialize the contents (more work)
Check MSDN here for simple file stream
FileStream fs=new FileStream("c:\\Variables.txt", FileMode.Append, FileAccess.Write, FileShare.Write);
fs.Close();
StreamWriter sw=new StreamWriter("c:\\Variables.txt", true, Encoding.ASCII);
string NextLine="This is the appended line.";
sw.Write(NextLine);
sw.Close();
dboarman
2010-02-04 06:13:37
A:
Dim op As New OpenFileDialog
op.ShowDialog()
If op.FileName <> "" Then
My.Computer.FileSystem.WriteAllText(op.FileName, TextBox1.Text)
End If
Microgen
2010-09-12 08:56:46