asaf ok

asaf ok

  • NA
  • 3
  • 4.6k

How to use System.Net.CredentialCache.DefaultCredentials - Urgent!!!

Oct 6 2011 9:12 AM
I would like to transfer by HTTP request to an external service logged user details.
I tried the following code:

  string url = "http://localhost";
  / / Create a 'HttpWebRequest' object with the specified url.
  HttpWebRequest myHttpWebRequest = (HttpWebRequest) WebRequest.Create (url);
  / / Assign the credentials of the logged in user or the user being impersonated.
  myHttpWebRequest.Credentials = System.Net.CredentialCache.DefaultCredentials;


But any attempt to get user data is always obtained as STRING empty and no values.

How do I use the class for the desired values ??or alternatively I'd like to receive other offers on how to resolve the problem ...



Answers (3)