How to save textBox to a file
-
Hi, I'm trying to save the context that i have in my textBox (Multi Line) to a text file, But to keep the lines order. i know how to do it with richTextBox-
foreach (string line in richTextBox.Lines) { textToSave.WriteLine(line); }
But i have to user textBox only... :( Someone has a idea? -
Hi, I'm trying to save the context that i have in my textBox (Multi Line) to a text file, But to keep the lines order. i know how to do it with richTextBox-
foreach (string line in richTextBox.Lines) { textToSave.WriteLine(line); }
But i have to user textBox only... :( Someone has a idea? -
Hi, I'm trying to save the context that i have in my textBox (Multi Line) to a text file, But to keep the lines order. i know how to do it with richTextBox-
foreach (string line in richTextBox.Lines) { textToSave.WriteLine(line); }
But i have to user textBox only... :( Someone has a idea? -
hi why you write the text line by line? using(StreamWriter sw = new StreamWriter(filename)) { sw.Write(textbox.Text); } regards