filesysteminfo

Missing directory and file info

旧时模样 提交于 2020-01-06 21:09:47
问题 The following is not returning a full list of files and directories: IEnumerable<FileSystemInfo> files = new DirectoryInfo("C:\\Windows\\System32\\drivers").EnumerateFileSystemInfos("*", SearchOption.AllDirectories); The application is run as a administrator. There are no additional file filter drivers in place. For example if I run: foreach (FileSystemInfo file in files) { Console.WriteLine(file.Name); } I get: en-US gm.dls gmreadme.txt UMDF wimmount.sys bfe.dll.mui ndiscap.sys.mui pacer.sys

Missing directory and file info

☆樱花仙子☆ 提交于 2020-01-06 21:07:34
问题 The following is not returning a full list of files and directories: IEnumerable<FileSystemInfo> files = new DirectoryInfo("C:\\Windows\\System32\\drivers").EnumerateFileSystemInfos("*", SearchOption.AllDirectories); The application is run as a administrator. There are no additional file filter drivers in place. For example if I run: foreach (FileSystemInfo file in files) { Console.WriteLine(file.Name); } I get: en-US gm.dls gmreadme.txt UMDF wimmount.sys bfe.dll.mui ndiscap.sys.mui pacer.sys

How can I get a full path of a given path (can be a directory or file, or even full path) using C#?

不羁的心 提交于 2019-12-11 01:24:33
问题 The closest I get is using new FileInfo(path).FullPath , but as far as I know FileInfo is for files only, not directory. See also my comments to Jon Skeet's answer here for context. 回答1: The Path class also gives you a lot of nice methods and properties, e.g. GetFullPath(). See MSDN for all details. 回答2: Path.GetFullPath() 回答3: I think it's- DirectoryInfo.FullName 回答4: Try this: String strYourFullPath = ""; IO.Path.GetDirectoryName(strYourFullPath) 回答5: Use the DirectoryInfo class which