private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
FileInfo file1 = new FileInfo("c:\\file.txt");
StreamWriter sw = file1.CreateText();
sw.WriteLine(txtOutput.Text + System.Environment.NewLine);
sw.Close();
MessageBox.Show("File saved to C:\\file.txt");
}
I realize now that this takes all the text, then adds a newline at the end of all of it. Am I going to have to read the textbox until I find a newline then use WriteLine to save each string individually, or is there an easier solution to this that I'm not seeing?
Thanks for any help!

New Topic/Question
Reply




MultiQuote





|