private void button2_Click(object sender, EventArgs e) { SaveFileDialog sd = new SaveFileDialog(); using (sd) { if (sd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { XmlDocument document = new XmlDocument(); XmlElement root = document.CreateElement("mainroot"); document.AppendChild(root); XmlElement name = document.CreateElement("Name"); name.InnerText = textBox1.Text; document.DocumentElement.AppendChild(name); root.AppendChild(name); document.Save(sd.FileName); - Well so do not create a new one, but open the specified one. msdn.microsoft.com/ru-ru/library/875kz807(v=vs.110).aspx - Andrey NOP
- What is the problem? You still haven't decided? - Andrey NOP
- @AndreyNOP decided, just did it differently - Python_noob
- Make a decision answer - Andrew NOP
|