一个很简单的代码:
Directory.CreateDirectory(C:\users\xxx\desktop\newfolder)失败了,说没有权限。即便我把everyone加上并给了所有权限也不行,为啥呢?

解决方案 »

  1.   

    试试给NETWORK SERVICE帐号可读写的权限
      

  2.   

    users属于个人账户的特殊文件夹,估计只能以Administrator登录才可以
      

  3.   

    添加mainfest,方法C# manifest 
    1. Open your exe in VS (file -> open file) 
    2. Right click on it and select add resource 
    3. Click "Import..." from the dialog 
    4. Select your manifest file 
    5. In the "Resource Type" field, enter "RT_MANIFEST" 
    6. In the property grid, change the resource ID from "101" to "1". 
    7. Save the exe 
      

  4.   

    我只看到 xxx.exe - 101 - RCDATA的标签标题,但找不到这玩意儿,更不知道上哪儿改,请问该如何做?
      

  5.   

    http://stackoverflow.com/questions/1992905/c-error-creating-directory-in-specialfolder-localapplicationdata-on-windows-7-as
      

  6.   


    老孟哥,即便是其他分区目录我添加everyone也不行,请问可以讲解下原因和解决方法么?
      

  7.   

    晕啊我怎么把关键问题给忘交代了我是 windows 7 系统。。