C# WebClient acting slow the first time

后端 未结 3 1193
清酒与你
清酒与你 2020-12-10 12:55

I am using a WebClient to download a string from a website (which just contains plain text, nothing else), so I use the DownloadString method:

WebClient wc =         


        
3条回答
  •  温柔的废话
    2020-12-10 13:19

    Setting the Proxy property of your WebClient object to null should eliminate the delays you're seeing. Alternatively if you've configured your system to use a proxy it can be retrieved with WebRequest.GetSystemWebProxy. The second method should eliminate the delay in either case.

提交回复
热议问题