示例#1
0
        public void ticks_repost(object Params)
        {
            VKAPI vk = new VKAPI(Program.accessToken);

            for (int i = 0; i < this.listBoxGroups.Items.Count; i++)
            {
                Thread.Sleep(800);

                XmlDocument posting = vk.WallRepost(this.textBoxRepost.Text, this.textBoxText.Text, this.listBoxGroups.Items[i].ToString().Replace('-', ' '), "", "", "");
                foreach (XmlNode node1 in posting.SelectNodes("/error/error_code"))
                {
                    if (node1.InnerText == "14")
                    {
                        object[] Params1 = { Params, posting.SelectSingleNode("/error/captcha_img").InnerText.ToString() };

                        var form = ((FormCapcha)((object[])((Params1)[0]))[0]);
                        form.Tag = "stop";

                        while (form.Tag.ToString() == "stop") //ждем пока пользователь не нажмет кнопку
                        {
                            form.Invoke(new Action(() =>
                            {
                                form.Show();
                                form.label1.Text = ((object[])(Params1))[1].ToString(); //передаем в форму переменную
                            }));
                        }
                        //XmlDocument posting = vk.WallRepost(this.textBox2.Text, this.textBoxText.Text, this.listBoxGroups.Items[i].ToString(), "", "", "");

                        XmlDocument postingCapcha = vk.WallRepost(this.textBoxRepost.Text, this.textBoxText.Text, this.listBoxGroups.Items[i].ToString(), "", posting.SelectSingleNode("/error/captcha_sid").InnerText.ToString(), form.Tag.ToString());
                        //XmlDocument inviteCapcha = vk.InviteUserToGroup(Convert.ToInt32(this.textBoxEventID.Text), Convert.ToInt32(node.InnerText), invite.SelectSingleNode("/error/captcha_sid").InnerText.ToString(), form.Tag.ToString());
                    }
                }
            }
        }