Ejemplo n.º 1
0
        public bool IsSuccessful(ref HttpRequest request, Account account)
        {
            var config = new ConfigXNet();

            config.ConfigDefault(ref request);
            string html = request.Get("https://member.lazada.vn/user/login").ToString();

            config.AddHeaderXCSRFToken(ref request);
            string contentPost = "{\"email\":\"" + account.Email + "\",\"password\":\"" + account.Password + "\"}";

            html = request.Post("https://member.lazada.vn/user/api/login", contentPost, "application/json").ToString();
            if (html.Contains("\"success\":true"))
            {
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        public bool IsSuccessful(ref HttpRequest request, Account account)
        {
            var config = new ConfigXNet();

            config.ConfigDefault(ref request);
            if (EmailWasUsed(ref request, account.Email))
            {
                Debug.WriteLine(account.Email, "Trùng");
                return(false);
            }
            Thread.Sleep(3000);
            config.AddHeaderXCSRFToken(ref request);
            string contentPost = "{\"email\":\"" + account.Email + "\",\"password\":\"" + account.Password + "\",\"re-password\":\"" + account.Password + "\",\"name\":\"" + account.FullName + "\",\"enableNewsletter\":true,\"month\":\"" + account.Month + "\",\"day\":" + account.Day + ",\"year\":" + account.Year + ",\"birthday\":\"" + account.BirthDay + "\",\"gender\":\"" + account.Gender + "\",\"loading\":\"false\"}";
            //request.Proxy = HttpProxyClient.Parse("127.0.0.1:8888");
            string html = request.Post("https://member.lazada.vn/user/api/register", contentPost, "application/json").ToString();

            if (html.Contains("\"success\":true"))
            {
                return(true);
            }
            return(false);
        }