Exemplo n.º 1
0
        public void lists()
        {
            project.SendInfoToLog("подготовка списков", true);
            var recip      = project.Tables["recip"];
            var email      = project.Tables["email"];
            var subj       = project.Lists["subj"];
            var link       = project.Lists["link"];
            var paste_text = project.Lists["paste_text"];

            recip.Clear(); email.Clear(); subj.Clear(); link.Clear(); paste_text.Clear();
            string path = project.Variables["recip_list"].Value;
            var    val  = System.IO.File.ReadAllText(path);

            Macros.TextProcessing.ToTable(val, "\r\n", "Text", ":", "Text", project, recip);
            path = project.Variables["subj_list"].Value;
            val  = System.IO.File.ReadAllText(path);
            Macros.TextProcessing.ToList(val, "\r\n", "Text", project, subj);
            path = project.Variables["email_list"].Value;
            val  = System.IO.File.ReadAllText(path);
            Macros.TextProcessing.ToTable(val, "\r\n", "Text", ";", "Text", project, email);
            path = project.Variables["link_list"].Value;
            val  = System.IO.File.ReadAllText(path);
            Macros.TextProcessing.ToList(val, "\r\n", "Text", project, link);
            path = project.Variables["paste_text_list"].Value;
            val  = System.IO.File.ReadAllText(path);
            Macros.TextProcessing.ToList(val, "\r\n", "Text", project, paste_text);
            path = System.IO.File.ReadAllText(project.Directory + @"/set/s_bol.xml");
            path = Macros.TextProcessing.Replace(path, @"(?<=wait</Name><Value>).*?(?=</Value>)", project.Variables["limit_post_for_one_akk"].Value, "Regex", "All");
            path = Macros.TextProcessing.Replace(path, @"(?<=body</Name><Value>).*?(?=</Value>)", project.Variables["body"].Value, "Regex", "All");
            path = Macros.TextProcessing.Replace(path, @"(?<=proxy_type</Name><Value>).*?(?=</Value>)", project.Variables["proxy_type"].Value, "Regex", "All");
            val  = System.IO.File.ReadAllText(project.Variables["body"].Value);
            if (val.Contains(@"$PASTE_LINK$"))
            {
                path = Macros.TextProcessing.Replace(path, @"(?<=body_contains_link</Name><Value>).*?(?=</Value>)", "1", "Regex", "All");
            }
            else
            {
                path = Macros.TextProcessing.Replace(path, @"(?<=body_contains_link</Name><Value>).*?(?=</Value>)", "0", "Regex", "All");
            }
            if (val.Contains(@"$PASTE_TEXT$"))
            {
                path = Macros.TextProcessing.Replace(path, @"(?<=body_contains_text</Name><Value>).*?(?=</Value>)", "1", "Regex", "All");
            }
            else
            {
                path = Macros.TextProcessing.Replace(path, @"(?<=body_contains_text</Name><Value>).*?(?=</Value>)", "0", "Regex", "All");
            }
            System.IO.File.WriteAllText(project.Directory + @"/set/s_bol.xml", path);
            startInfo.FileName = string.Format(project.Directory + @"/set/s_bol.bat");
            Process.Start(startInfo);
            if (project.Variables["proxy_type"].Value == "nosok")
            {
                ZennoPoster.AddTries("Nosok", 1);
                System.Threading.Thread.Sleep(5 * 1000);
                if (!File.Exists(project.Directory + @"/proxy/proxy_nosok.txt"))
                {
                    System.Threading.Thread.Sleep(5 * 1000);
                }
            }

            int t = int.Parse(project.Variables["limit_post_for_one_akk"].Value);

            t = recip.RowCount / t;
            project.SendInfoToLog("Запуск потоков", true);
            System.Threading.Thread.Sleep(3 * 1000);

            ZennoPoster.AddTries("S_bol", t);
            System.Threading.Thread.Sleep(1 * 500);
        }