本文介绍了无法打开目录“mydocuments”在Windows 10上,C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我尝试打开目录MyDocuments,但它在Windows 10上不起作用。为什么以及如何解决问题?



private void button1_Click(object sender,EventArgs e)

{

FolderBrowserDialog fbd = new FolderBrowserDialog();

fbd.RootFolder = System.Environment.SpecialFolder.MyDocuments;

if(fbd.ShowDialog()== System.Windows.Forms.DialogResult.OK)

MessageBox.Show(fbd.SelectedPath);





}



提前致谢

Merh



我的尝试:



Hi

I try to open the directory "MyDocuments" but it dosen't work on windows 10. Why and how can I solve the problem?

private void button1_Click(object sender, EventArgs e)
{
FolderBrowserDialog fbd = new FolderBrowserDialog();
fbd.RootFolder = System.Environment.SpecialFolder.MyDocuments;
if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
MessageBox.Show(fbd.SelectedPath);


}

Thanks in advance
Merh

What I have tried:

private void button1_Click(object sender, EventArgs e)
{
      FolderBrowserDialog fbd = new FolderBrowserDialog();
      fbd.RootFolder = System.Environment.SpecialFolder.MyDocuments;
       if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            MessageBox.Show(fbd.SelectedPath);
          

}

推荐答案

string path = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);


这篇关于无法打开目录“mydocuments”在Windows 10上,C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 09:09