Вход на сайт
Как прочитать C:\Documents and Settings
540 просмотров
Перейти к просмотру всей ветки
в ответ AlexNek 28.03.19 13:19
оказалось немного хитрее
DirectoryInfo dir = new DirectoryInfo(currentPath);
если dir.Attributes содержит флаг FileAttributes.ReparsePoint то это виртуальный каталог и нефиг его читать. Может указывать и на другой диск. Запускать прогу нужно с правами админа.
Интересные штуки на 10-ке вылезли
//currentPath = "C:\\Users\\Public\\Documents\\My Music"-realPath="C:\\Users\\Public\\Music" //currentPath = "C:\\Users\\Public\\Documents\\My Pictures" - realPath="C:\\Users\\Public\\Pictures" //currentPath = "C:\\Users\\Public\\Documents\\My Videos" - realPath="C:\\Users\\Public\\Videos" //currentPath = "C:\\Windows\\System32" - realPath="C:\\Windows\\SysWOW64"