Answer the question
In order to leave comments, you need to log in
Authorization c # vk_api, how can I do it?
I compiled this code, but the token variable contains only the login.vk.com page code I
use xNet
public static void auth(string login, string passw)
{
using (var net = new HttpRequest())
{
net.UserAgent = Http.ChromeUserAgent();
CookieDictionary cookie = new CookieDictionary(false);
net.Cookies = cookie;
string result;
net.Post(String.Format("https://login.vk.com/?act=logi&email={0}&pass={1}", login, passw)); //авторизация
string token = net.Get("https://oauth.vk.com/authorize?client_id=5487405&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=friends&response_type=token&v=5.52").ToString(); // запрос токена
net.AllowAutoRedirect = false;
MessageBox.Show(token);
}
}
Answer the question
In order to leave comments, you need to log in
It has long been done "in a tricky way", if you open this link in a browser, then make sure that with this approach you will either have to do an analysis using Fiddler, Wireshark, etc., and then fake all the necessary requests and process redirects, parse, etc., or use WebBrowser, it's easier and better, this option is "official".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question