System.Windows.Forms.SaveFileDialog saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
//show save as... file dialog
if(saveFileDialog1.ShowDialog()!=DialogResult.OK)return;
//get file name from user
string fileName=saveFileDialog1.FileName;
FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite);
try
{
fs.Write(....);//write data into file
}
catch(Exception ex)
{
MessageBox.Show("Error in Write File");
}
finally
{
fs.Close();
}