Example #1
0
        public bool Login(ref Accounts acc, string captcha)
        {
            string get = http.Request("GET", "https://manager.sunfrogshirts.com/Login.cfm");
            Match  m   = Regex.Match(get, "name=\"botchecker\" value=\"(.*?)\"");

            if (!m.Success)
            {
                return(false);
            }
            FormData form = new FormData();

            form.Add(new FormElement("username", acc.EMAIL));
            form.Add(new FormElement("password", acc.PASS));
            form.Add(new FormElement("g-recaptcha-response", captcha));
            form.Add(new FormElement("login", ""));
            form.Add(new FormElement("botchecker", m.Groups[1].Value));
            Console.WriteLine(form.ToPostString());
            string html    = http.Request("POST", "https://manager.sunfrogshirts.com/Login.cfm", null, form.GetData(), false);
            var    headers = http.GetResponseHeaders();

            Console.WriteLine(headers.ToString());
            if (!headers.ToString().Contains("dashboard"))
            {
                return(false);
            }
            return(true);
        }