我正在打開系統卷信息子文件夾中的內存映射文件。我知道並在資源管理器中看到它存在那裏,並且路徑是正確的(它是從資源管理器複製粘貼的),此外,該路徑的File.Exists返回true,但MemoryMappedFile.OpenExisting失敗並顯示DirectoryNotFoundException。爲什麼? (我擁有系統卷信息文件夾和子文件夾的所有權利)。File.Exists返回true,並且OpenExisting失敗,出現DirectoryNotFoundException
一些代碼:
const string filePath = @"C:\\System Volume Information\\Foo\\2.ext";
bool exists = File.Exists(filePath); //is true
using (MemoryMappedFile bitmapFile = MemoryMappedFile.OpenExisting(filePath, MemoryMappedFileRights.Read)) //Throws DirectoryNotFoundException
{
...
}