SaveFileDialog

// Configure save file dialog box
  
  Microsoft.Win32.SaveFileDialog dlg 
= new Microsoft.Win32.SaveFileDialog();
  dlg.FileName 
= "Document"// Default file name
  
  dlg.DefaultExt 
= ".text"// Default file extension
  
  dlg.Filter 
= "Text documents (.txt)|*.txt"// Filter files by extension
  
  
  
// Show save file dialog box
  
  Nullable
<bool> result = dlg.ShowDialog();
  
  
// Process save file dialog box results
  
  
if (result == true)
  {
      
// Save document
  
      
string filename = dlg.FileName;
  }
  
原文地址:https://www.cnblogs.com/zhangtao/p/2347557.html