Connecting Tech Pros Worldwide Help | Site Map

WebClient with username + password

Ram Baruch
Guest
 
Posts: n/a
#1: Nov 16 '05
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.


Aravind C
Guest
 
Posts: n/a
#2: Nov 16 '05

re: WebClient with username + password


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

"Ram Baruch" <ram_ba_ruch@newsgroups.nospam> wrote in message
news:%23jQHgl6REHA.3140@tk2msftngp13.phx.gbl...[color=blue]
> 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[/color]
in[color=blue]
> the WebClient class?
> Regards,
> Ram.
>
>[/color]


Ram Baruch
Guest
 
Posts: n/a
#3: Nov 16 '05

re: WebClient with username + password


thanx!

"Aravind C" <aravindcorera@nospam.hotmail.com> wrote in message
news:exjmcy6REHA.556@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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
>
> "Ram Baruch" <ram_ba_ruch@newsgroups.nospam> wrote in message
> news:%23jQHgl6REHA.3140@tk2msftngp13.phx.gbl...[color=green]
> > Hi,
> > I'm trying to use WebClient class to upload data. In order to upload it,[/color][/color]
I[color=blue][color=green]
> > need to use my username and password. Does somebody know how can I set[/color][/color]
it[color=blue]
> in[color=green]
> > the WebClient class?
> > Regards,
> > Ram.
> >
> >[/color]
>
>[/color]


Steven Cheng[MSFT]
Guest
 
Posts: n/a
#4: Nov 16 '05

re: WebClient with username + password


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...NetWebClientCl
assCredentialsTopic.asp?frame=true

#NetworkCredential Class
http://msdn.microsoft.com/library/en...NetNetworkCred
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

Closed Thread