Textbox to textfile and otherway around C#

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hello all,

Does somebody know's an example how to save a multiline textBox into a
textfile in C# ?
I tried to find one on the internet, but couldn't find one, maybe I'm
searching in the wrong direction.

If somebody could help me out ?

Another question : Is there a little (standard) tool to help me set up
SQLCe databases and tables ?

Thanks,

Peter.
 
Umm.. something like that:

public void SaveTextBox(TextBox textBox, string fileName)
{
using(StreamWriter writer = new StreamWriter(fileName))
{
writer.Write(textBox.Text);
writer.Flush();
}

}
 
Hello Alex,

Thanks for the solution !!
I had no clue that it is this complicated to achieve.

Maybe to much to ask, but how to put the contents of a textfile into a
textbox (multiline)

Kind regards,

Peter.
 
Alex - got it both working !, I didn't know that I just needed the
Streamreader to read back the saved file - thanks again for the usefull
tips

Peter.
 
Back
Top