标签:代码 cto redirect wpf filedia rect led == store
把内容过程经常用到的一些内容片段收藏起来,如下的内容内容是关于C# WPF中调用打开文件对话框的内容。private string OpenDialog()
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Title = "选择文件";
openFileDialog.FileName = string.Empty;
openFileDialog.FilterIndex = 1;
openFileDialog.RestoreDirectory = true;
openFileDialog.DefaultExt = "txt";
if(openFileDialog.ShowDialog()==true)
{
return openFileDialog.FileName;
}else
{
return "";
}
}
标签:代码 cto redirect wpf filedia rect led == store
原文地址:https://blog.51cto.com/14393435/2430351