Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- using System.Net;
- namespace LoginRequest
- {
- class LoginFunc
- {
- public static bool Login(String Username, String Password)
- {
- string data = null;
- data = "auth_key=880ea6a14ea49e853634fbdc5015a024&referer=http%3A%2F%2Ftalagamingnetwork.com%2Findex.php%3F%2Findex&ips_username=" + Username + "&ips_password=" + Password + "&rememberMe=1";
- try
- {
- WebRequest request = WebRequest.Create("http://talagamingnetwork.com/index.php?app=core&module=global§ion=login&do=process");
- request.Method = WebRequestMethods.Http.Post;
- request.ContentType = "application/x-www-form-urlencoded";
- request.ContentLength = data.Length;
- StreamWriter rStream = new StreamWriter(request.GetRequestStream());
- rStream.Write(data);
- rStream.Flush();
- rStream.Close();
- WebResponse response = request.GetResponse();
- StreamReader resReader = new StreamReader(response.GetResponseStream());
- string str = resReader.ReadToEnd();
- if (str.Contains("Username or password incorrect."))
- {
- return false;
- }
- else
- {
- return true;
- }
- response.Close();
- }
- catch (Exception ex)
- {
- return false;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement