https post username and pass
Hello, What I need to develop is an application that contains 2 textboxes, 1 button, 1 label. In the first text box, I will put my user name. In the second my password. When I click the button, The software should visit this page: https://eole.telecom-paristech.fr/ and post my username and my password (that I have already entered in the textboxes) The label should then display the HTML code of the page returned after the successful login. How can I do this? I am getting too much trouble to find a good help on how should I use the POST method in HTTPrequest. Can anyone write a small code for me? THANKS
Sam HobbsPosted Dec 8, 2009, 11:58 AM
Look at KeePass Password Safe; it does that type of thing. If you are able to use it to do automated logink then you at least know it is possible.
theLizardPosted Dec 7, 2009, 6:56 PM
Trying to send password info to the server from your form does not send the data in a form expected by the server page.
You cannot just create a form with 2 text boxes then send a post request and expect it to work, you need protocols which can only be provided by the site owner.
Sorry...
Assaad MouawadPosted Dec 7, 2009, 6:09 PM
Currently my app contains 2 forms: the first one contains just a webbrowser component pointing always to the school site, when I logged in to the site,I have to press another button to switch to the second form (sending the webbrowser HTML as a parameter), the second form gives the HTML to a class that parse it, extract all the data, schedules, news... and the form is just a UI to display those infos.
Everything is working fine! For the server side, it is just like I have opened internet explorer on my device and checked the website! He don't know what I am doing with the HTML after.
I am only annoyed by the fact I should press the logon button each time! So what is happening when I am pressing the button, is there a way to know? I guess it is a normal HTTPS POST.
And I don't see why should I be worry and why should i get the appointment
theLizardPosted Dec 7, 2009, 6:00 PM
Assaad MouawadPosted Dec 7, 2009, 5:49 PM
Sam HobbsPosted Dec 7, 2009, 5:36 PM
Now that I think about it, the person could easily be asking for help developing a phishing web site. They want to create a web page that takes the user id and password and then gets the page that results from signing in. That is all that is needed to steal student's security information. If so, I hope the university and the law catches the person and applies relevant justice.
theLizardPosted Dec 7, 2009, 4:09 PM
Appart from the fact that the site is a secured server, you would need to know what the site expects in it's user name password request.
It is not as simple as giving a name and password, the site may want these in a particular way for example the post may need to be formatted like theUserr=UserName@thePassword=password@newUser=1 if you do not send the request the way that they want it, it would never succeed even if you gave the correct user name and password (well that's how a good security system would work)
If you do own the site then whats the problem?
Sam HobbsPosted Dec 7, 2009, 12:05 PM
Assaad MouawadPosted Dec 7, 2009, 10:25 AM
1- I want to build a windows form application with just these 4 things: 2 textboxes, 1 button, 1 label.
2- The user enters in the first text box his user name and in the second his password.
3- When he clicks the button, the application should visit the "https://eole.telecom-paristech.fr/", and login in using the credentials that are already in the text boxes, after successful login, the label should display the Html code that the site generates.
So here we go:
private void button1_Click(object sender, EventArgs e)
{
//Step 1 easy, check if both of the text boxes are not empty, otherwise messagebox.show(you should enter username/password) and return;
//Step 2: connect to the https://eole.telecom-paristech.fr/
Here is the difficulty, What should I put right here to tell the site that the username is textbox1.text and the password is textbox2.text
How to use the HttpWebRequest? I think I should do a "POST" request or something like that.
//Step3: get the HTML response of the server, and put it in the label1.text
}
I know it is easier to use a webbrowser control, but If I do so, I can't have control on the user name and the password of the customer. (It would be just as if he logged in directly from internet explorer).
This application looks silly. In fact it is not what I am going to develop. If I can build this one, I wouldn't have a problem in the final app I am going to build. So I am trying to simplify things just to find people who can Help. So I repeat again: How can I take the user name and password from 2 textboxes field and use them to connect to the mentioned site?. Consider that I want to develop an application that stores 5 usernames and passwords, and every 10 minutes, this app would log on to the site with a different user name and password to get info. So the login would be automatic, using Http request...
Thanks again, Hope I am clear now.
Hiren SoniPosted Dec 7, 2009, 6:50 AM
Hiren SoniPosted Dec 7, 2009, 6:50 AM