Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public override bool Login(string username, string password)
- {
- HttpWebRequest templateRequest = base.GetTemplateRequest("https://secure.runescape.com/m=weblogin/login.ws");
- templateRequest.Method = "POST";
- templateRequest.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
- templateRequest.ContentType = "application/x-www-form-urlencoded";
- templateRequest.Headers.Add("Accept-Encoding", "en-GB,en-US;q=0.8,en;q=0.6");
- templateRequest.Headers.Add("Accept-Language", "gzip, deflate, br");
- templateRequest.Referer = this.mainUrl;
- templateRequest.CookieContainer = this.session;
- using (Stream requestStream = templateRequest.GetRequestStream())
- {
- string s = string.Format("username={0}&password={1}&mod=www&ssl=1&dest=account_settings.ws", username, password);
- byte[] bytes = Encoding.UTF8.GetBytes(s);
- requestStream.Write(bytes, 0, bytes.Length);
- }
- bool result;
- using (HttpWebResponse httpWebResponse = (HttpWebResponse)templateRequest.GetResponse())
- {
- using (StreamReader streamReader = new StreamReader(httpWebResponse.GetResponseStream()))
- {
- string text = streamReader.ReadToEnd();
- this.HasMembership = !text.Contains("Currently Not a Member");
- result = text.Contains("Sign Out");
- }
- }
- return result;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement