Answered by:
Is it possible to pass Username and Password to a website?

Question
-
For some websites, it requires login Username and Password. How can I "pass" the value from my c# Desktop Application to these two fields?
What I want to do in my C# Application is Step 2:
-------------------------------------------------------------------------
Step 1: Go to a website, e.g. MyFavoriteSite.comStep 2: I have to input my Username and Password
Step 3: Click "Ok" button to login.
Please help ~~
Thursday, April 12, 2012 6:33 AM
Answers
-
It depends on the manor in which you're attempting to get at the site (are you embedding a WebBrowser, using HTTPRequest, etc.).
It also depends on how the site does it's authentication. Is it a custom form with username/password, a popup, window auth, etc. If it's custom, the details of how they implemented their custom form will of course affect how you programmatically fill it out.
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 2:07 PM -
http://forums.asp.net/t/1507150.aspx
http://stackoverflow.com/questions/5869785/post-username-and-password-to-login-page-programmatically
Kindly have a look at the above link.
Regards,
Narendran Ponpandiyan
- Proposed as answer by Mohsen Shamohammadi Thursday, April 12, 2012 11:12 AM
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 6:40 AM -
an interesting way to do this is to do a web site automation please take a look at this link
http://www.codeproject.com/Articles/16738/Automating-web-browsing
A man's dreams are an index to his greatness
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 9:18 AM -
another link
http://stackoverflow.com/questions/1549538/best-method-for-website-automation
A man's dreams are an index to his greatness
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 9:21 AM -
To wit, the website needs to support some kind of single sign on mechanism that will give you the ability to get hold of an authentication token to either pass around the URL or stick in a cookie by invoking a web method on the target site or you have to manually fill in these fields by automating the browser. If you have any control over the remote web site, I highly recommend you do the former, as it is way less annoying than programming against the web site's login page.
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 2:12 PM
All replies
-
http://forums.asp.net/t/1507150.aspx
http://stackoverflow.com/questions/5869785/post-username-and-password-to-login-page-programmatically
Kindly have a look at the above link.
Regards,
Narendran Ponpandiyan
- Proposed as answer by Mohsen Shamohammadi Thursday, April 12, 2012 11:12 AM
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 6:40 AM -
an interesting way to do this is to do a web site automation please take a look at this link
http://www.codeproject.com/Articles/16738/Automating-web-browsing
A man's dreams are an index to his greatness
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 9:18 AM -
another link
http://stackoverflow.com/questions/1549538/best-method-for-website-automation
A man's dreams are an index to his greatness
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 9:21 AM -
It depends on the manor in which you're attempting to get at the site (are you embedding a WebBrowser, using HTTPRequest, etc.).
It also depends on how the site does it's authentication. Is it a custom form with username/password, a popup, window auth, etc. If it's custom, the details of how they implemented their custom form will of course affect how you programmatically fill it out.
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 2:07 PM -
To wit, the website needs to support some kind of single sign on mechanism that will give you the ability to get hold of an authentication token to either pass around the URL or stick in a cookie by invoking a web method on the target site or you have to manually fill in these fields by automating the browser. If you have any control over the remote web site, I highly recommend you do the former, as it is way less annoying than programming against the web site's login page.
- Marked as answer by Bob Shen Tuesday, April 24, 2012 9:38 AM
Thursday, April 12, 2012 2:12 PM