1

When I use code like this:

System.Net.WebClient objClient = new WebClient();
string url = "http://google.com";
objClient.DownloadString(url);

It takes 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.

benRollag
  • 1,219
  • 4
  • 16
  • 21
backdoor
  • 13
  • 2
  • so you are wondering why it's so slow? is that what you're asking? – Matthew Groves May 17 '10 at 14:35
  • its possible...arealy i have unchecked "Enable LMHOSTS Lookup" from Connection Properties>Networking Tab>Internet Protocol(TCP/IP) > Properties>Advanced>WINS Tab>Enable LMHOSTS Lookup check box. and its takes some effect on the problem and decrease connection establish time but still not best performance it takes. i think bowth these Corrects the problem... – backdoor May 17 '10 at 15:06

2 Answers2

1

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.

Igal Tabachnik
  • 31,174
  • 15
  • 92
  • 157
  • thanks man. i do this and it works perfect. more attractive is when i uncheck "Automatically detect settings" again no change where made and with last configuration so i have best performance... thanks again – backdoor May 17 '10 at 14:50
0

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.

naivists
  • 32,681
  • 5
  • 61
  • 85