System.Net issues
When I use code like this:
System.Net.WebClient objClient = new WebClient();
string url = "http://google.com";
objClient.DownloadString(url);
It take开发者_运维知识库s a couple of seconds for the connection to get established and then the downloading starts. I reinstalled Windows yesterday and this problem started. This problem seems to happen when I reinstall Windows.
Does anybody know why this problem occurs? Thanks all.
See if you have a proxy configured in your Internet Explorer settings (Tools - Internet Options - Connections - LAN Settings). Make sure you got Automatically detect settings
checked.
Maybe you have automatic configuration of proxy enabled in your Internet Explorer? Since you don't specificially set the proxy settings of your WebClient object, it looks at Internet explorer settings.
精彩评论