码迷,mamicode.com
首页 > 其他好文 > 详细

Using Save As Dialog in WPF

时间:2014-10-06 17:02:50      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:style   blog   color   io   os   ar   sp   div   c   

 1                 Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
 2                 dlg.FileName = "User.txt"; // Default file name
 3                 dlg.DefaultExt = ".txt"; // Default file extension
 4                 dlg.Filter = "Text documents (.txt)|*.txt"; // Filter files by extension
 5 
 6                 var dir = System.IO.Path.GetDirectoryName(this.txtPlace.Text);
 7                 dlg.InitialDirectory = dir;
 8 
 9                 // Show save file dialog box
10                 Nullable<bool> result = dlg.ShowDialog();
11 
12                 // Process save file dialog box results
13                 if (result == true)
14                 {
15                     // Save document
16                     this.txtPlace.Text = dlg.FileName;
17                 }

 

Using Save As Dialog in WPF

标签:style   blog   color   io   os   ar   sp   div   c   

原文地址:http://www.cnblogs.com/cicaday/p/4008233.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!