I work with Vk.net. I try to do 2 factor authorization. According to the documentation for the place of 5 parameters it is necessary to transfer a variable in text format. Here is an example for the console. In the documentation:
var api = new VkApi(); api.Authorize(new ApiAuthParams { ApplicationId = 123456, Login = "Login", Password = "Password", Settings = Settings.All, TwoFactorAuthorization = () => { Console.WriteLine("Enter Code:"); return Console.ReadLine(); } }); I have a winform project. I want to make a form call to enter the code. But I can't do it. I tried this:
Form3 form = new Form3(); form.Show(); I also tried to call a method here,
private void Hello() { Form3 form = new Form3(); form.Show(); } внутри авторизации вызывал так: TwoFactorAuthorization = () => { Hello(); return DataBank.Text; } knocks error:
System.InvalidOperationException: "Эта операция не поддерживается для относительных URI-адресов."