Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Net;
  4.  
  5. namespace LoginRequest
  6. {
  7. class LoginFunc
  8. {
  9. public static bool Login(String Username, String Password)
  10. {
  11. string data = null;
  12. data = "auth_key=880ea6a14ea49e853634fbdc5015a024&referer=http%3A%2F%2Ftalagamingnetwork.com%2Findex.php%3F%2Findex&ips_username=" + Username + "&ips_password=" + Password + "&rememberMe=1";
  13. try
  14. {
  15. WebRequest request = WebRequest.Create("http://talagamingnetwork.com/index.php?app=core&module=global&section=login&do=process");
  16. request.Method = WebRequestMethods.Http.Post;
  17. request.ContentType = "application/x-www-form-urlencoded";
  18. request.ContentLength = data.Length;
  19. StreamWriter rStream = new StreamWriter(request.GetRequestStream());
  20. rStream.Write(data);
  21. rStream.Flush();
  22. rStream.Close();
  23. WebResponse response = request.GetResponse();
  24. StreamReader resReader = new StreamReader(response.GetResponseStream());
  25. string str = resReader.ReadToEnd();
  26. if (str.Contains("Username or password incorrect."))
  27. {
  28. return false;
  29. }
  30. else
  31. {
  32. return true;
  33. }
  34. response.Close();
  35. }
  36. catch (Exception ex)
  37. {
  38. return false;
  39. }
  40.  
  41.  
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement