打开文件选择对话框与设置默认路径
程序员文章站
2022-07-28 07:59:36
OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); ......
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
DialogResult dr = openFileDialog.ShowDialog();
打开一个文件选择对话框,默认路径为桌面。