C# winform 窗体弹出选择目录或文件 的对话框
2021-07-19 23:16
标签:text selected dia evo class inf dial pen win //弹出一个选择目录的对话框 //弹出一个选择文件的对话框
C# winform 窗体弹出选择目录或文件 的对话框 标签:text selected dia evo class inf dial pen win 原文地址:http://www.cnblogs.com/liao290161655/p/8047344.htmlprivatevoid btnSelectPath_Click(object sender, EventArgs e) //弹出一个选择目录的对话框
{
FolderBrowserDialog path = new FolderBrowserDialog();
path.ShowDialog();
this.txtPath.Text = path.SelectedPath;
}
privatevoid btnSelectFile_Click(object sender, EventArgs e) //弹出一个选择文件的对话框
{
OpenFileDialog file = new OpenFileDialog();
file.ShowDialog();
this.txtFile.Text = file.SafeFileName;
}
文章标题:C# winform 窗体弹出选择目录或文件 的对话框
文章链接:http://soscw.com/index.php/essay/106401.html