Link to home
Create AccountLog in
Avatar of MotherTrker
MotherTrker

asked on

Passing Authentication via HTTP Web Request

I have created an application updater that goes out to a website, downloads a manifest and then via httpwebrequest starts downloading files.  Everything works as it should.  I then decided to add a layer of security and placed a password on the directory.  When you open up a browser and browse to the url you are now prompted for a username and password.  

My question is how can I pass the username and password to my webrequest so the update continues without end user intervention?  This is not on a  network(no AD), I am assuming the website is using basic authentication.  

when i use this method My.Computer.Network.DownloadFile("http://updates.we bsite.com/updates", strManifest, username,password) it works fine.  

Please can you show me how to accomplish this?
ASKER CERTIFIED SOLUTION
Avatar of MotherTrker
MotherTrker

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Avatar of Shahan Ayyub
Shahan Ayyub
Flag of Pakistan image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of MotherTrker
MotherTrker

ASKER

i figured it out on my own
No problem. The link has the same content.
Shahan,
I bet I was closing this as you were typing.  Thank you for the pointer, I was able to get this working prior to.  Had you been a bit quicker I would of awarded you some points for posting. I am not sure If I still can be if so, i will make it happen.

Thanks.
Sahan deserves points on this, I was able to figure out the solution but Sahan pointed me to a great article that would help out anyone attempting to do the same.  Please award him points
Thanks Sahan
I just see this question and I had the link I posted to you. So when I posted I see another comment on the same time :)

You have already posted an objection which can leads to give points to me. Thank you for consideration.
Thanks