private string SelectPath() //弹出一个选择目录的对话框
{
FolderBrowserDialog path = new FolderBrowserDialog();
path.ShowDialog();
return path.SelectedPath;
}
private string SelectFile() //弹出一个选择文件的对话框
{
OpenFileDialog file = new OpenFileDialog();
file.ShowDialog();
return file.SafeFileName;
}
C# WinForm 选择目录路径和文件路径
时间: 2025-01-02 03:53:57