M
Matthew Law
Hi,
I'm writing a C# app to retrieve a web page which is protected by a
..htaccess file. I've been trying various things for a while and
continue to get a network exception:
The remote server returned an error: (401) Unauthorized.
Can anyone tell me where I am going wrong? My current code effort is:
....
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(URL);
myReq.MaximumAutomaticRedirections = 4;
myReq.MaximumResponseHeadersLength = 4;
myReq.Credentials = new System.Net.NetworkCredential("myuser",
"letmein");
....
Many thanks in advance,
Matt.
I'm writing a C# app to retrieve a web page which is protected by a
..htaccess file. I've been trying various things for a while and
continue to get a network exception:
The remote server returned an error: (401) Unauthorized.
Can anyone tell me where I am going wrong? My current code effort is:
....
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(URL);
myReq.MaximumAutomaticRedirections = 4;
myReq.MaximumResponseHeadersLength = 4;
myReq.Credentials = new System.Net.NetworkCredential("myuser",
"letmein");
....
Many thanks in advance,
Matt.