Solved

How to login to member are on website through boxes on exe?

Posted on 2003-11-16
6
333 Views
Last Modified: 2010-04-05
Hello,
Is there any way I can login to a member area on a website using an exe?
I would like to have 2 boxes, username and password.
Then a users submits these and it will login to the member area in IE and open the page logged in.
If anyone knows how I can do this i would REALLY appreciate the help, I have been trying for a while but have never done anything like it before.
Thanks
John
0
Comment
Question by:Custom-Hosting
6 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 43 total points
ID: 9758658
Depends on the login mechanism of a website. Some sites are set up to be secure, requiring authentication. If you use the Indy components then you'll need to set user name and password in the request property and set BasicAuthentication to true. Other sites just expect the username and password to be part of the POST data that is send to the server. In that case you have to use the TidHTTP.Post method, providing username and password in a separate stream or stringlist.
It's worse if you want to log in to e.g. Yahoo because Yahoo requires client-side encryption. If you log in to Yahoo then a Java-Script in the client calculates a hash value, then sends the hashed value to the server for verification.

In other words, there is no -generic- method to log in to any site. You first have to examine the website itself to check how the login information must be send to it.
0
 

Assisted Solution

by:Smortex
Smortex earned 41 total points
ID: 9759042
Maybe you can do this like that :
1 - Take a look to the login page source in order to find the submission form :

<form method="post" action="/login.php" name="DoLogin" [...]>
  Login : <input type="edit" name="login" [...]>
  Password : <input type="edit" name="pass" [...]>
  <input type="submit">
</form>

2 - Edit this "Form". You may change the input type to "hidden", and you can of course remove all the text between the inputs. In the login and password input, add "value="%s"" Take a look to the "action" property of the form, complete it if it is not a full url (beginning with http://...). It may look like this :

<form method="post" action="http://www.mypage.com/login.php" name="DoLogin">
  <input type="hidden" name="login" value="%s">
  <input type="hidden" name="pass" value="%s">
</form>

3 - Create a form with a TEdit for the username, an other for the password, and a button.

4 - On the button's event, write a html file including :
 -> the modified html-form with the informations of your software (You can use : "Format(myForm,[LoginEdit.Text,PasswordEdit.Text]);"). This may write (in my example) :
 -> A javascript function to auto-submit the form

It may llok like this :

<html>
  <head>
    <script>
      function LogMe() {
        document.DoLogin.submit();
      }
    </script>
  </head>
  <body onLoad="LogMe();">
    <form method="post" action="http://www.mypage.com/login.php" name="DoLogin">
      <input type="hidden" name="login" value="username">
      <input type="hidden" name="pass" value="password">
    </form>
  </body>
</html>

This work quite well, bug the password is written in the file, so it is important to remove the file as soon as it is not used.

Hope that's help !

Regards
0
 
LVL 26

Assisted Solution

by:EddieShipman
EddieShipman earned 41 total points
ID: 9764797
0
 

Author Comment

by:Custom-Hosting
ID: 9796301
Hey,
Thanks to everyone that helped.
I decided to use a TWebBrowser and just navigate to a login.html page which had the login form and open it in _blank so it opened IE for the member area.
I will split to points for everyone that helped.
Thanks again,
John
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question