Hi,
I'm trying to download the web page source code from a HTTPS URL, my
code is as follows:
Code:
System.Net.WebClient WC = new System.Net.WebClient();
NetworkCredential Cred = new NetworkCredential();
Cred.UserName = "user";
Cred.Password = "pass";
WC.Credentials = Cred;
System.IO.Stream s = WC.OpenRead
("https://xxxxxx/data.html");
System.IO.StreamReader sr = new System.IO.StreamReader
(s);
string webpage = sr.ReadToEnd();
I get a 401 (unauthorized) exception, and i am 100% sure the
credentials are correct, and work perfectly in my web browser for
the file.
I have tested this code without the credentials, on a standard HTTP
URL and it works fine.
Any ideas what I am doing wrong?
Thanks
Jack
--
--------------------------------- --- -- -
Posted with NewsLeecher v3.7 Final
Web @ http://www.newsleecher.com/?usenet
------------------- ----- ---- -- -
--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access