而在搜索文件访问被拒绝错误 [英] Access Denied error in while searching for files
本文介绍了而在搜索文件访问被拒绝错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得到以下错误,当我尝试搜索文件C:\目录。
i get the following error when i try to search for files in c:\ directory..
访问路径 C:\ $ RECYCLE.BIN\S-1-5-21-3560828095-1020290111-2102031911-500'被拒绝
Access to the path 'C:\$RECYCLE.BIN\S-1-5-21-3560828095-1020290111-2102031911-500' is denied.
使用的代码IM是:
private void button12_Click(object sender, EventArgs e)
{
string[] files = Directory.GetFiles("C:\\",
"*.*",
SearchOption.AllDirectories);
// Display all the files.
foreach (string file in files)
{
MessageBox.Show(file);
}
}
`
`
推荐答案
这是一个问题...怎么样?回收站子目录是由你的机器,你就从尝试访问其他一些帐户的回收站运行此帐户的个人用户所拥有。
And this is a problem... how? The recycle bin subdirectories are owned by the individual users on your machine and the account you're running this from is attempting to access some OTHER account's recycle bin.
这篇关于而在搜索文件访问被拒绝错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文