-1

I'm success to save objects in xml file by path that I given. now I want to save in path that user select( I want FileDialog Box that the user select in the computer exactly where to save and can to creat/replace new file.xml)

I try to do by this guide but I don't understand clearly so it doesn't works. http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filename.aspx

I will be more that happy to get some help. Thanks and have a good day. :)

B.Tubul
  • 13
  • 4

1 Answers1

0

You can use OpenFileDialog like this:

OpenFileDialog theDialog = new OpenFileDialog();
theDialog.Title = "Open Text File";
theDialog.Filter = "TXT files|*.txt";
theDialog.InitialDirectory = @"C:\";
if (theDialog.ShowDialog() == DialogResult.OK)
{
    // if user selected a file, show it's name
    MessageBox.Show(theDialog.FileName.ToString());
}
Mustafa Chelik
  • 2,113
  • 2
  • 17
  • 29
  • Exactly what I look for. Thanks. There is any way to save on something without delete it ? I mean if I have text file I want to open it and save on the continue the text not instead the text ? – B.Tubul Jan 12 '15 at 08:25
  • Sorry, I didn't get what you are asking. Do you want to select a existing file? – Mustafa Chelik Jan 12 '15 at 17:58