Example #1
0
        private void onPlay(object sender, RoutedEventArgs e)
        {
            if (stage != StageEnum.CHOSEN)
            {
                return;
            }

            string     startMessage = "";
            OpenPhrase phrase       = new OpenPhrase(debug);

            phrase.ShowDialog();
            startMessage = phrase.startMessage;

            SendAll(startMessage, true);
            playedTime = DateTime.Now;
            stage      = StageEnum.LAUCHED;
            List <String> bans = new List <string>();

            foreach (PersonModel p in Persons)
            {
                string domain = p.id.ToString();
                bans.Add(domain);
            }
            if (debug == false)
            {
                FileParser.setBanList(bans);
            }
        }
Example #2
0
        //отправляем сообщения всем выделенным чатам
        private void sendAllMessages(object sender, RoutedEventArgs e)
        {
            //открыть всем в VK
            //List<PersonChat> resevers = new List<PersonChat>();
            //foreach (KeyValuePair<string, PersonChat> kvp in personWindows)
            //{
            //    PersonChat pc = kvp.Value;
            //    if (!pc.banned)
            //    {
            //        resevers.Add(pc);
            //    }
            //}
            //if (resevers.Count == 0)
            //{
            //    return;
            //}\

            if (stage != StageEnum.CHOSEN)
            {
                return;
            }



            string     startMessage = "";
            OpenPhrase phrase       = new OpenPhrase(debug);

            phrase.ShowDialog();
            startMessage = phrase.startMessage;
            Clipboard.SetText(startMessage);

            //SendAll(startMessage, true);
            playedTime = DateTime.Now;
            //stage = StageEnum.LAUCHED;

            //баним
            List <String> bans   = new List <string>();
            List <String> bansId = new List <string>();

            foreach (PersonModel p in Persons)
            {
                string domain = p.Domain;
                bans.Add(domain);
                bansId.Add(p.id.ToString());
            }
            if (debug == false)
            {
                FileParser.setBanList(bansId);
            }

            //открываем vkокна
            int count = bans.Count;

            System.Diagnostics.Process.Start("http://google.com");
            Thread.Sleep(2000);
            prepareBrouser();



            int i = 0;

            while (i < count)
            {
                try
                {
                    string domain = bans[i];
                    string url    = "https://vk.com/" + domain;
                    System.Diagnostics.Process.Start(url);
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                int    stable = 10 * 1000;
                Random rnd    = new Random();
                int    dice   = rnd.Next(1, 1500);
                Thread.Sleep(stable + dice);
                i++;
            }
            //спим минутку перед написанием;
            Thread.Sleep(60 * 1000);


            //for (int k = Persons.Count - 1; k >= 0; k--)
            //{
            //    var p = Persons[k];
            //    if (p == null)
            //    {
            //        continue;
            //    }
            //    int j = Persons.IndexOf(p);
            //    writeMessage(startMessage, j, p);
            //}
            //foreach (PersonModel p in Persons)
            //{
            //    if (p == null)
            //    {
            //        continue;
            //    }
            //    int j = Persons.IndexOf(p);
            //    writeMessage(startMessage, j, p);
            //}
        }