WebClient Download - “Access to the path 'c:\\windows\\system32\\inetsrv\\MyPrintManager.exe' is denied”

后端 未结 2 1597
醉话见心
醉话见心 2021-01-25 23:34

I am attempting to download a file from another IIS site on my local machine. I have my main website that is trying to download from another public site that contains a few file

相关标签:
2条回答
  • 2021-01-25 23:52

    No, it's attempting to save the file to C:\windows\system32\inetsrv\MyPrintManager.exe.

    That's because C:\windows\system32\inetsrv is the working directory for your process, and you've just given a relative filename.

    Specify an absolute filename which says exactly where you want the file to be stored, and it should be fine.

    0 讨论(0)
  • 2021-01-26 00:14
    WebClient web = new WebClient();
    string url = "http://.../FILENAME.jpg";
    web.DownloadFile(new Uri(url), "C:/FILENAME.jpg");
    
    0 讨论(0)
提交回复
热议问题