Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. private void cmdTest_Click(object sender, EventArgs e)
  2. {
  3.  
  4. Uri uriLogin = new Uri("http://feverclan.com/forums/login.php?do=login");
  5. StringBuilder data = new StringBuilder();
  6. data.Append("vb_login_username=" + txtUsername.Text + "&vb_login_password=" + txtPassword.Text
  7. + "securitytoken=guest&"
  8. + "cookieuser=checked&"
  9. + "do=login");
  10.  
  11. HttpWebRequest login = HttpWebRequest.Create(uriLogin) as HttpWebRequest;
  12. login.CookieContainer = cookieContainer;
  13. login.Method = WebRequestMethods.Http.Post;
  14. login.ContentLength = data.Length;
  15. login.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:47.0) Gecko/20100101 Firefox/47.0";
  16. login.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
  17. login.ContentType = "text/html; charset=ISO-8859-1";
  18. StreamWriter writer = new StreamWriter(login.GetRequestStream());
  19. writer.Write(data);
  20. writer.Close();
  21. login.GetResponse();
  22. HttpWebResponse response = login.GetResponse() as HttpWebResponse;
  23. foreach (Cookie c in response.Cookies)
  24. {
  25. cookieContainer2.Add(c);
  26. }
  27. StreamReader reader = new StreamReader(response.GetResponseStream());
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement