Solved

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

Posted on 2003-11-16
6
336 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

737 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