Exemplo n.º 1
0
        private void _Authorize(string login, string password, string captchaSid, string captchaKey)
        {
            login = HttpUtility.UrlEncode(login);
            password = HttpUtility.UrlEncode(password);
            string request = string.Format(
              @"grant_type=password&scope=nohttps,notify,friends,photos,audio,video,docs,status,messages,notification&client_id={0}&client_secret={1}&username={2}&password={3}",
              AuthorizeHelper.ClientId, AuthorizeHelper.ClientSecret, login, password);

            // Check if need to show captcha...
            if (captchaSid != null && captchaKey != null)
            {
                request = request + "&captcha_sid=" +
                    HttpUtility.UrlEncode(captchaSid) + "&captcha_key=" +
                    HttpUtility.UrlEncode(captchaKey);
            }

            VKWebClient client = new VKWebClient();
            client.SendRequest(@"https://oauth.vk.com/token", request, _ParseResponse);
        }
Exemplo n.º 2
0
 public void Execute()
 {
     VKWebClient client = new VKWebClient();
     string request = String.Format(@"act=a_check&key={0}&ts={1}&wait=25&mode={2}", _key, _ts, (int)_mode);
     client.SendRequest(_server, request, _ParseResponse);
 }