在WPF中调用另存为对话框

                 Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
dlg.FileName = "User.txt"; // Default file name
dlg.DefaultExt = ".txt"; // Default file extension
dlg.Filter = "Text documents (.txt)|*.txt"; // Filter files by extension var dir = System.IO.Path.GetDirectoryName(this.txtPlace.Text);
dlg.InitialDirectory = dir; // Show save file dialog box
Nullable<bool> result = dlg.ShowDialog(); // Process save file dialog box results
if (result == true)
{
// Save document
this.txtPlace.Text = dlg.FileName;
}

Using Save As Dialog in WPF

上一篇:安装XP时BIOS的设置(ahci ide)


下一篇:html post和get的区别