C# Access to the path 'C:\Documents and Settings\' is denied

前端 未结 4 1720
灰色年华
灰色年华 2020-12-11 05:33

I\'m using a simple DirectoryInfo to grab all directories on the root on the C drive. However, I\'m running under administrator and i\'m getting the error of pa

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-11 05:54

    C:\Document and Settings is a junction point and additionnally You cannot access the System Volume Information directory.which is placed on C:\ root you have to trap any security exceptions and skip it to work your code.

提交回复
热议问题