WebClient with username + password

  • Thread starter Thread starter Aravind C
  • Start date Start date
A

Aravind C

Hi Ram,

You could try setting the Credentials property of the WebClient.

WebClient webClient = new WebClient();
webClient.Credentials = new System.Net.NetworkCredential("UserName",
"Password", "Domain");

Regards,
Aravind C
 
Hi,
I'm trying to use WebClient class to upload data. In order to upload it, I
need to use my username and password. Does somebody know how can I set it in
the WebClient class?
Regards,
Ram.
 
thanx!

Aravind C said:
Hi Ram,

You could try setting the Credentials property of the WebClient.

WebClient webClient = new WebClient();
webClient.Credentials = new System.Net.NetworkCredential("UserName",
"Password", "Domain");

Regards,
Aravind C

it
 
Thanks for Aravind 's informative suggestions.

Hi Ram,

Here are some reference on the WebClient.Credentials Property and
the System.Net.NetworkCredential class in MSDN:

#WebClient.Credentials Property
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemNetWebClientCl
assCredentialsTopic.asp?frame=true

#NetworkCredential Class
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemNetNetworkCred
entialClassTopic.asp?frame=true

Hope also helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Back
Top