After completing this code, the button sticks and nothing happens.
vkapi vkapi = new vkapi ();
Private Void Button1_Click (Object Sender, Eventargs E)
{
VKAPI.Authorize (New ApiauthParams ()
{
Login = "***",
Password = "***",
Applicationid = 7644324,
Settings = settings.all.
});
if (vkapi.isauthorized == TRUE)
{
MessageBox.Show ("+");
}
}
Is it possible to expect two-factor authorization? If yes, how to make
Answer 1, Authority 100%
Two-Factor Authorization:
static void main (String [] Args)
{
var api = new vkapi ();
APIAUTHORIZE (New ApiauthParams
{
Applicationid = 123456,
Login = "login",
Password = "password",
Settings = settings.all,
Twofactorauthorization = () = & gt;
{
Console.WriteLine ("Enter Code:");
RETURN CONSOLE.REDLINE ();
}
});
Console.Writeline (API.Token);
}
https://vknet.github.io/vk/authorize/
If it does not work, then try to get a token through:
https: //oauth.vk.com/Token?grant_type=password& ;client_id=2274003& ;client_secret=hhbzxrka2uz6jb1inysh& ;username=phone_or_mail&password=yourpassword& ;v=5.78
(Change the fields there on your login and password).
From some times, VK prohibits issuing full rights to the token.
Perhaps when settings = settings.all
there is a trouble.
For this link, you can get a token with full rights.
(How it works can google).
and further – & gt;
static void main (String [] Args)
{
var api = new vkapi ();
APIAUTHORIZE (New ApiauthParams
{
Accesstoken = "Access_Token"
});
Console.Writeline (API.Token);
var ris = API.groups.get (new groupsgetparams ());
Console.Writeline (res.TotalCount);
Console.ReadLine ();
}