System.IO.File.Exists 和FileInfo类Exists 属性的区别?为何前者返回文件存在,后者返回不存在
麦壳饼 2011-08-17 11:40:04 我本地有一个文件是 msi文件, 文件确实是存在。 路径 在 运行 中可以打开 !
但是 FileInfo 的 Exists属性返回该文件不存在。 但是System.IO.File.Exists 返回存在!
我看了 他们反编译后的大概的代码,
他们各自似乎都是通过这个函数来获得
WIN32_FILE_ATTRIBUTE_DATA
然后从他的 属性中获得的。
internal static int FillAttributeInfo(string path, ref Win32Native.WIN32_FILE_ATTRIBUTE_DATA data, bool tryagain, bool returnErrorOnNotFound)
{
但是我现在很郁闷, 为什么会不一样?