HttpWebRequest/HttpWebResponse

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Im trying to download a file from ISS Server.
But it returns back an error: 401 - Not authorized.
I tried everything.
Im getting mad in a fast pace.
If u could help me would be great.


HttpWebRequest req = (HttpWebRequest)WebRequest.Create(downloadUrl);
req.Credentials= new NetworkCredential("USER","PWD");
req.Method = "GET";
HttpWebResponse resp = (HttpWebResponse) req.GetResponse();

i get the error on the last line...why?

Thx
 
In your vdir properties on IIS machine turn off Windows Authentication and
switch on Basic Authentication
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top