public static void StartThread()
 {
     try
     {
         SaveData.WriteToLog("SYSTEM", $"Начало работы программы. Режим {WorkWithAccount.OperatingMode}");
         Threads.Clear();
         SaveData.WriteToLog("SYSTEM", $"Создаем потоки");
         for (int i = 0; i < countThread; i++)
         {
             Thread thread = new Thread(() => WorkWithAccount.StartWork())
             {
                 IsBackground = true
             };
             thread.Name = $"Поток {i}";
             Threads.Add(thread);
             Threads[i].Start();
         }
         SaveData.WriteToLog("SYSTEM", $"Создано {Threads.Count.ToString()} потоков");
         new Thread(() => CheckCompletion())
         {
             IsBackground = true
         }.Start();
     }
     catch (Exception exception) { MessageBox.Show(exception.Message); }
 }
        private void guna2Button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 200; i++)
            {
                using (HttpRequest request = new HttpRequest())
                {
                    request.Cookies    = new CookieStorage();
                    request.UseCookies = true;
                    request.UserAgent  = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; MSAppHost/3.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.19042";
                    int    min  = 200;
                    int    max  = 8000;
                    Random rand = new Random((int)DateTime.Now.Ticks);

                    #region Делаем Get запрос на главную страницу сайта. Парсим: Headers XInstagramAJAX, Headers csrf_token, Библиотека ConsumerLibCommons.
                    request.AddHeader("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
                    request.AddHeader("Accept-Language", "ru-UA,ru;q=0.8,en-US;q=0.5,en;q=0.2");
                    request.AddHeader("Upgrade-Insecure-Requests", "1");
                    request.AddHeadersOrder(new List <string>()
                    {
                        "Accept",
                        "Accept-Language",
                        "Upgrade-Insecure-Requests",
                        "User-Agent",
                        "Host",
                        "Connection",
                        "Accept-Encoding"
                    });

                    Thread.Sleep(rand.Next(min, max));
                    string Response = request.Get("Https://www.instagram.com/").ToString();

                    string XInstagramAJAX = Response.BetweenOrEmpty("rollout_hash\":\"", "\"");
                    string csrf_token     = Response.BetweenOrEmpty("csrf_token\":\"", "\"");

                    string[] librarys           = Response.BetweenOrEmpty("<link rel=\"manifest\" href=\"/data/manifest.json\">", "<script type=\"text/javascript\">").Split('>');
                    string   ConsumerLibCommons = WorkWithAccount.ParseCurrentLibrary(librarys, "ConsumerLibCommons.js");
                    #endregion

                    #region Делаем Get запрос для парсинга Headers FbAppID. Post INTERSTITIAL, PAGE_TOP, TOOLTIP
                    request.AddHeader("Referer", "https://www.instagram.com/");
                    request.AddHeader("Accept", "*/*");
                    request.AddHeader("Accept-Language", "ru-UA,ru;q=0.8,en-US;q=0.5,en;q=0.2");
                    request.AddHeadersOrder(new List <string>()
                    {
                        "Referer",
                        "Accept",
                        "Accept-Language",
                        "User-Agent",
                        "Host",
                        "Connection",
                        "Cookie",
                        "Accept-Encoding"
                    });

                    Thread.Sleep(rand.Next(min, max));
                    Response = request.Get(ConsumerLibCommons).ToString();

                    string PWAAppId = Response.BetweenOrEmpty("e.instagramWindowsPWAAppId='", "'");
                    #endregion

                    #region Делаем Get запрос на страницу регистрации
                    request.AddHeader("Referer", "https://www.instagram.com/accounts/emailsignup/");
                    request.AddHeader("Accept", "*/*");
                    request.AddHeader("Accept-Language", "ru-UA,ru;q=0.8,en-US;q=0.5,en;q=0.2");
                    request.AddHeader("X-IG-App-ID", PWAAppId);
                    request.AddHeader("X-IG-WWW-Claim", "0");
                    request.AddHeader("X-Requested-With", "XMLHttpRequest");

                    request.AddHeadersOrder(new List <string>()
                    {
                        "Referer",
                        "Accept",
                        "Accept-Language",
                        "X-IG-App-ID",
                        "X-IG-WWW-Claim",
                        "X-Requested-With",
                        "User-Agent",
                        "Host",
                        "Connection",
                        "Cookie",
                        "Accept-Encoding"
                    });

                    Thread.Sleep(rand.Next(min, max));
                    request.Get("Https://www.instagram.com/accounts/emailsignup/?__a=1");
                    #endregion
                }
            }
        }