I am trying to save a file using DialogResult and StringBuilder. After making the text, I am calling the following code to save the file:
DialogResult
StringBuilder
There is a constructor for filename, appendMode, encoding.
With a proper using block it looks like:
using
if (dr == DialogResult.OK) { using (StreamWriter sw = new StreamWriter(saveFileDialog1.FileName, false, Encoding.UTF8)) { sw.Write(sb.ToString()); //sw.Close(); } }