This is my code. What am i trying to do is connect to webservice and download a file to a specific location.
Code throws an exception. Looks like i should retun some value to service before i download a file (not sure tho).
WebClient webClient = new WebClient();
NetworkCredential netCred=new NetworkCredential();
netCred.UserName="user";
netCred.Password="pass";
netCred.Domain="domain";
webClient.Credentials = netCred;
WebProxy wp = new WebProxy();
wp.Credentials = netCred;
wp.Address = new Uri(@"http://okolje.arso.gov.si/service/prevozniki.zip");
webClient.Proxy = wp;
webClient.DownloadFile("http://okolje.arso.gov.si/service/prevozniki.zip", @"C:\arso\prevozniki.zip");