Hello! I saw your post on how to save the content of a textbox to a .txt file. Maybe you can help me. I have a textbox, textBox1, and a button, Save. When you push Save it should save the content of textBox1 to a .txt file. I copied the code, but I received some errors:
<<'System.IO.Fi leMode' does not contain a definition for 'OpenORCreate'> >
and
<<'System.IO.St reamWriter' does not contain a definition for 'close' and no extension method 'close' accepting a first argument of type 'System.IO.Stre amWriter' could be found (are you missing a using directive or an assembly reference?)>>
The code looks like this:
private void button1_Click(o bject sender, EventArgs e)
{
String theData = textBox1.Text;

FileStream aFile = new FileStream("myT extFile.txt", FileMode.OpenOR Create);
StreamWriter sw = new StreamWriter(aF ile);
sw.WriteLine(th eData);
sw.close();
}