C# 浏览文件夹地址

来源:互联网 发布:航天信息软件下载 编辑:程序博客网 时间:2024/06/07 12:49

C# 浏览文件夹地址

<pre name="code" class="csharp">            FolderBrowserDialog dialog = new FolderBrowserDialog();            dialog.Description = "请选择文件路径";            if (dialog.ShowDialog() == DialogResult.OK)            {                string foldPath = dialog.SelectedPath;                txtFilePath.Text = foldPath;            }



C# 浏览文件地址

<pre name="code" class="csharp">            OpenFileDialog fileDialog = new OpenFileDialog();            fileDialog.Multiselect = true;            fileDialog.Title = "请选择文件";            fileDialog.Filter = "所有文件(*.*)|*.*";            if (fileDialog.ShowDialog() == DialogResult.OK)            {                string file = fileDialog.FileName;                txtFilePath.Text = file;            }



C# 打开文件夹

            System.Diagnostics.Process.Start("Explorer.exe", "c:\\");//打开文件夹


0 0