0
        setDirty();
        SaveFileDialog saveFileDialog1 = new SaveFileDialog();
        saveFileDialog1.Title = "";
        saveFileDialog1.OverwritePrompt = true;
        var dialogResult = saveFileDialog1.ShowDialog();
        if (dialogResult == DialogResult.OK)
        {
            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("CheckLoggin = {0}", chkLoggin.Checked).AppendLine();
            sb.AppendFormat("LogFilePath = {0}", txtFilePath.Text).AppendLine();
            sb.AppendFormat("NumberOfThreads = {0}", txtNumOfThreads.Text).AppendLine();

            File.WriteAllText(saveFileDialog1.FileName, sb.ToString());

            saveFileDialog1.Close();
        }
    }
2
Contributors
3
Replies
7
Views
2 Years
Discussion Span
Last Post by ChrisHunter
0

Replace saveFileDialog1.Close(); with Application.Exit();

saveFileDialog1.Close(); terminates the application

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.