Using a library
VK.NET.
Using the Function LoginIn autorisoes.
private void LoginIn(VkApi vk, string login, string password)
{
vk.Authorize(new ApiAuthParams
{
ApplicationId = AppID,
Login = Login,
Password = password,
Settings = Settings.All
});
}
The problem is that after login the second account appears VkApiAuthorizationException exception(wrong username or password). In fact, the pair login the password is correct. The exception only occurs when authorizing a second account regardless of the login and password.
The whole code:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private vk1 VkApi = new VkApi(), vk2 = new VkApi();
#region logins
private void LoginIn(VkApi vk, string login, string password)
{
vk.Authorize(new ApiAuthParams
{
ApplicationId = 5427437,
Login = Login,
Password = password,
Settings = Settings.All
});
}
private void CheckBox1_Checked(object sender, RoutedEventArgs e)
{
LoginIn(vk1, Login1.Text, Password1.Text);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
vk1.Status.Set("1");
vk2.Status.Set("2");
}
private void CheckBox2_Checked(object sender, RoutedEventArgs e)
{
LoginIn(vk2, Login2.Text, Password2.Text);
}
#endregion
}
PS Say katemobile built on this SDK: https://github.com/thest1/Android-VKontakte-SDK the scoop there. - Elna.Volkman92 commented on July 9th 19 at 13:52