A
amine
I really need help on this please. I am writing an
application for an Ipaq and I am trying to enable the
application to connect to a DAV server which can is
basically an HTTP server that acts like an FTP server. I
used the following code
WebRequest req = WebRequest.Create (url);
req.Credentials = new NetworkCredential (username, pass);
WebResponse res = req.GetResponse();
the previous code caused the server to display the 401
error :Unauthorized (WebException).
So I thought maybe there is a proxy in the way so I used
the following code
WebRequest req = WebRequest.Create (url);
WebProxy curr_proxy = new WebProxy (url, true);
curr_proxy.Credentials = new NetworkCredential (username,
pass);
page_req.Proxy = curr_proxy;
WebResponse res = req.GetResponse();
that caused the same exact problem
I know for sure that the username and password are correct
cuz I can connect to that site through the browser (When
trying to access the site it prompts me for username and
password just as an HTTP server would.) and I know the
code works for other sites cuz I tried. (I didnt try an
password protected site though)
Oh ya and I also tried HttpWebRequest and HttpWebResponse
same problem
PLEASSE HELP. this is my senior thesis and I am basically
screwed if I dont figure this out soon
THANK YOU
application for an Ipaq and I am trying to enable the
application to connect to a DAV server which can is
basically an HTTP server that acts like an FTP server. I
used the following code
WebRequest req = WebRequest.Create (url);
req.Credentials = new NetworkCredential (username, pass);
WebResponse res = req.GetResponse();
the previous code caused the server to display the 401
error :Unauthorized (WebException).
So I thought maybe there is a proxy in the way so I used
the following code
WebRequest req = WebRequest.Create (url);
WebProxy curr_proxy = new WebProxy (url, true);
curr_proxy.Credentials = new NetworkCredential (username,
pass);
page_req.Proxy = curr_proxy;
WebResponse res = req.GetResponse();
that caused the same exact problem
I know for sure that the username and password are correct
cuz I can connect to that site through the browser (When
trying to access the site it prompts me for username and
password just as an HTTP server would.) and I know the
code works for other sites cuz I tried. (I didnt try an
password protected site though)
Oh ya and I also tried HttpWebRequest and HttpWebResponse
same problem
PLEASSE HELP. this is my senior thesis and I am basically
screwed if I dont figure this out soon
THANK YOU