首页 > 代码库 > Using Save As Dialog in WPF
Using Save As Dialog in WPF
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 box10 Nullable<bool> result = dlg.ShowDialog();11 12 // Process save file dialog box results13 if (result == true)14 {15 // Save document16 this.txtPlace.Text = dlg.FileName;17 }
Using Save As Dialog in WPF
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。