Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows.Forms;
- using System.Diagnostics;
- namespace PortalLogin2
- {
- public partial class Form1 : Form
- {
- bool mHooked;
- public Form1()
- {
- InitializeComponent();
- webBrowser1.DocumentCompleted += webBrowser1_DocumentCompleted;
- }
- private void button1_Click(object sender, EventArgs e)
- {
- string input = "https://en-gb.facebook.com/";
- Process.Start(input);
- }
- void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
- {
- if (mHooked) return;
- HtmlDocument doc = webBrowser1.Document;
- HtmlElement username = doc.GetElementById("email");
- HtmlElement password = doc.GetElementById("pass");
- HtmlElement submit = doc.GetElementById("u_0_");
- string txtUser = "insert username here";
- string txtPass = "insert password here";
- doc.GetElementById("email").InnerText = txtUser.ToString();
- doc.GetElementById("pass").InnerText = txtPass.ToString();
- submit.InvokeMember("click");
- mHooked = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement