470,612 Members | 2,362 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,612 developers. It's quick & easy.

how to force username & password while accesing http url instead of "defaultcredentials"

hello friends
i m connecting to http or https url programatically through console
application using follwoing methods of credentilas but if there is
username & password for that url through this code I m able to download

files from that url using "DefaultCredentials" but i want to use
password and username to access resources if tht url contains. & if for

tht specific url if user enters wrong username & password so tht he
must not able to acess tht files from tht url.

WebClient request= new WebClient();
request.Credentials=CredentialCache.DefaultCredent ials;
so is thrre any method to replace "DefaultCredentials" & I can use
password & usename of tht url so my application will be more safe.
thanks,
Sachin

Oct 17 '06 #1
1 1485
Thus wrote gu*************@gmail.com,
hello friends
i m connecting to http or https url programatically through console
application using follwoing methods of credentilas but if there is
username & password for that url through this code I m able to
download

files from that url using "DefaultCredentials" but i want to use
password and username to access resources if tht url contains. & if
for

tht specific url if user enters wrong username & password so tht he
must not able to acess tht files from tht url.

WebClient request= new WebClient();
request.Credentials=CredentialCache.DefaultCredent ials;
so is thrre any method to replace "DefaultCredentials" & I can use
password & usename of tht url so my application will be more safe.
Sending DefaultCredentials is all but useless for accessing Internet resources.

Depending on the type of authentication used by the web site, you either
set HttpWebRequest.Credentials to a NetworkCredentials object or send user
name and password as URL-encoded string as form data.

Cheers,
--
Joerg Jooss
ne********@joergjooss.de
Oct 17 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by ag | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.