Advertisement
Guest User

Untitled

a guest
Apr 13th, 2016
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3. using System.Diagnostics;
  4.  
  5. namespace PortalLogin2
  6. {
  7. public partial class Form1 : Form
  8. {
  9.  
  10. bool mHooked;
  11.  
  12. public Form1()
  13. {
  14. InitializeComponent();
  15. webBrowser1.DocumentCompleted += webBrowser1_DocumentCompleted;
  16. }
  17.  
  18. private void button1_Click(object sender, EventArgs e)
  19. {
  20. string input = "https://en-gb.facebook.com/";
  21. Process.Start(input);
  22. }
  23. void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
  24. {
  25. if (mHooked) return;
  26.  
  27. HtmlDocument doc = webBrowser1.Document;
  28.  
  29. HtmlElement username = doc.GetElementById("email");
  30. HtmlElement password = doc.GetElementById("pass");
  31. HtmlElement submit = doc.GetElementById("u_0_");
  32.  
  33. string txtUser = "insert username here";
  34. string txtPass = "insert password here";
  35. doc.GetElementById("email").InnerText = txtUser.ToString();
  36. doc.GetElementById("pass").InnerText = txtPass.ToString();
  37.  
  38. submit.InvokeMember("click");
  39. mHooked = true;
  40. }
  41.  
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement