Beispiel #1
0
 static VkCaptchaSolver()
 {
     Vk = new VkApi(new VkCaptchaUiSolver());
     Vk.Authorize(new ApiAuthParams()
     {
         ApplicationId = Settings.Current.ApplicationId,
         Login         = Settings.Current.Login,
         Password      = Settings.Current.Password,
         Settings      = VkNet.Enums.Filters.Settings.All
                         | VkNet.Enums.Filters.Settings.Offline
     });
     UsersSolvers.InitializeUsersIds(Vk);
 }
Beispiel #2
0
        public static void InitializeUsersIds(VkApi vk)
        {
            var hObject  = HierarchicalObject.FromFile(Constants.UsersToSendFilePath);
            var usersIds = new List <long>();

            for (int i = 0; hObject[i] is string; i++)
            {
                var userId = VkUtils.GetUserIdByUriName(vk, (string)hObject[i]);
                usersIds.Add(userId.Value);
            }

            Current = new UsersSolvers()
            {
                UsersIds = usersIds.ToArray()
            };
        }