Exemplo n.º 1
0
        public void SendVerifier(string method, string country, string phone, SendVerifierCallback callback)
        {
            sendVerifierQeury["idvType"]       = method;
            sendVerifierQeury["MobileCountry"] = country;
            sendVerifierQeury["MobileNumber"]  = phone;
            sendVerifierQeury["PhoneType"]     = "MOBILE";
            sendVerifierQeury["MobileCarrier"] = "";

            var sendVerifierUrl = "https://accounts.google.com/b/0/IdvChallenge?idvContinueHandler=SERVICE&service=ah";

            var cl = new WebClientWithCookies();

            cl.UploadValuesAsync(new Uri(sendVerifierUrl), sendVerifierQeury);
            cl.UploadValuesCompleted += (s, o) => {
                var html = o.Error == null?Encoding.UTF8.GetString(o.Result) : "";

                if (html.Contains("\"idvGivenAnswer\""))
                {
                    verifyQuery = initQuery(html);
                    callback(true);
                }
                else
                {
                    callback(false);
                }
            };
        }
Exemplo n.º 2
0
        public void SendVerifier(string method, string country, string phone, SendVerifierCallback callback) {
            sendVerifierQeury["idvType"] = method;
            sendVerifierQeury["MobileCountry"] = country;
            sendVerifierQeury["MobileNumber"] = phone;
            sendVerifierQeury["PhoneType"] = "MOBILE";
            sendVerifierQeury["MobileCarrier"] = "";

            var sendVerifierUrl = "https://accounts.google.com/b/0/IdvChallenge?idvContinueHandler=SERVICE&service=ah";

            var cl = new WebClientWithCookies();
            cl.UploadValuesAsync(new Uri(sendVerifierUrl), sendVerifierQeury);
            cl.UploadValuesCompleted += (s, o) => {
                var html = o.Error == null ? Encoding.UTF8.GetString(o.Result) : "";

                if (html.Contains("\"idvGivenAnswer\"")) {
                    verifyQuery = initQuery(html);
                    callback(true);
                }
                else {
                    callback(false);
                }
            };
        }