WebClient generates (401) Unauthorized error

后端 未结 5 1903
予麋鹿
予麋鹿 2020-12-06 09:14

I have the following code running in a windows service:

WebClient webClient = new WebClient();
webClient.Credentials = new NetworkCredential(\"me\", \"12345\         


        
5条回答
  •  鱼传尺愫
    2020-12-06 09:46

    According to the msdn docs the exception could be because the method has been called simultaneously on multiple threads. The DownloadFile method also requires a completely qualified URL such as http://evilcorp.com/.

提交回复
热议问题