private SaveFileDialog dialog = new SaveFileDialog();
private string StringData = "";
try
{
dialog.DefaultExt = ".txt";
dialog.Filter = "Text Files|*.txt|All Files|*.*";
dialog.FilterIndex = 1;
}
catch (Exception ex)
{
tblError.Text = "Error SaveFileDialog: " + ex.Message;
}
void MOSS_WS_GetDataCompleted(object sender,
WebServiceReference.GetDataCompletedEventArgs e)
{
string data = StringData;
if (this.dialog.ShowDialog() == true)
{
using (System.IO.Stream stream = dialog.OpenFile())
{
using (System.IO.StreamWriter writer =
new System.IO.StreamWriter(stream))
{
writer.Write(data);
writer.Close();
}
stream.Close();
}
}
}
Read more: Dudi Nissan's Blog