Directory.GetFiles不返回文件 [英] Directory.GetFiles Not returning a file

查看:483
本文介绍了Directory.GetFiles不返回文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我手动创建名为AAAAA.txt在C文本文件:\windows\System32,当我执行下面的代码:

I have manually created a text file called AAAAA.txt in c:\windows\System32 , when I execute the following code:

var sys32Files = Directory.GetFiles(@"C:\windows\System32");



它返回一堆文件,但AAAAA.txt不在该列表。在AAAAA.txt所有权限都一样坐上返回的那些文件。

It returns a bunch of files, but AAAAA.txt is not in that list. All permissions on the AAAAA.txt are the same as on those file that get returned.

有人能解释什么可能是这里的问题?

Could someone explain what may be the issue here?

是的,我以管理员身份运行。

推荐答案

你有一个64位的机器,并运行32位进程。该文件系统重定向意味着 C:\Windows\system32 将被重定向到 C:\Windows\SysWOW64 。如果你想在来查找文件C:\Windows\system32 您可以使用 C:\Windows\sysnative 别名。或编译64位。

You have a 64 bit machine and are running a 32 bit process. The file system redirector means that C:\Windows\system32 is redirected to C:\Windows\SysWOW64. If you want to find files in C:\Windows\system32 you can use the C:\Windows\sysnative alias. Or compile for 64 bit.

当然,你不应该摆在首位创建在系统目录中的文件。它属于Windows和你应该把它做好一个人。

Of course you should not be creating files in the system directory in the first place. It belongs to Windows and you should leave it well alone.

这篇关于Directory.GetFiles不返回文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆