private async void Comment_Click(object sender, RoutedEventArgs e)
        {
            Random random = new Random();

            string[] Proxy     = File.ReadAllLines(tbProxy.Text);
            var      ProxyDict = ProxyParse.Parse(Proxy[random.Next(0, Proxy.Length)]);
            var      user      = new HTTPBrowser()
            {
                UserName      = "******",
                Password      = "******",
                ProxyUserName = ProxyDict["username"],
                ProxyPassword = ProxyDict["password"],
                ip            = ProxyDict["ip"],
                port          = Int32.Parse(ProxyDict["port"]),
                //mail = new Mail(UserDick["maillogin"], UserDick["mailpassword"])
            };

            var res = await user.Login();

            var result = await user.InstaApi.ChooseVerifyMethod(0);
        }
        private async void Start(object sender, RoutedEventArgs e)
        {
            string [] Proxy = File.ReadAllLines(tbProxy.Text);

            string[] UsersString = File.ReadAllLines(tbUsers.Text);


            foreach (var userString in UsersString)
            {
                if (rbBrowser.IsChecked == true)
                {
                    Random random    = new Random();
                    var    UserDick  = UsersParse.Parse(userString);
                    var    ProxyDict = ProxyParse.Parse(Proxy[random.Next(0, Proxy.Length)]);
                    users.Add(new HTTPBrowser()
                    {
                        UserName      = UserDick["username"],
                        Password      = UserDick["password"],
                        ProxyUserName = ProxyDict["username"],
                        ProxyPassword = ProxyDict["password"],
                        ip            = ProxyDict["ip"],
                        port          = Int32.Parse(ProxyDict["port"]),
                        mail          = new Mail(UserDick["maillogin"], UserDick["mailpassword"])
                    });
                }
                else
                {
                    Random random    = new Random();
                    var    UserDick  = UsersParse.Parse(userString);
                    var    ProxyDict = ProxyParse.Parse(Proxy[random.Next(0, Proxy.Length)]);
                    Mail   mail;
                    try
                    {
                        mail = new Mail(UserDick["maillogin"], UserDick["mailpassword"]);
                    } catch
                    {
                        mail = null;
                    }
                    users.Add(new HTTPAndroid()
                    {
                        UserName      = UserDick["username"],
                        Password      = UserDick["password"],
                        ProxyUserName = ProxyDict["username"],
                        ProxyPassword = ProxyDict["password"],
                        ip            = ProxyDict["ip"],
                        port          = Int32.Parse(ProxyDict["port"]),
                        mail          = mail
                    });
                }
            }


            for (var i = 0; i < users.Count; i++)
            {
                workers.Add(new BackgroundWorker());
                workers[i].DoWork += new DoWorkEventHandler(InstagramTest_DoWork);
                //  workers[i].RunWorkerCompleted += InstagramTest_RunWorkerCompleted;
                workers[i].WorkerReportsProgress = true;
                workers[i].ProgressChanged      += new ProgressChangedEventHandler(bgw_ProgressChanged);
                List <Object> list = new List <object>();


                workers[i].RunWorkerAsync(users[i]);
            }



            //request = new HTTPBrowser();
            //Dictionary<string, string> parsed = ProxyParse.Parse("17t3080724:[email protected]:7951");
            //request.Login("KalkisVienna", "PULUFLbxArbR", parsed["ip"], Int32.Parse(parsed["port"]), parsed["username"], parsed["password"]);
        }
Ejemplo n.º 3
0
        private async void Start(object sender, RoutedEventArgs e)
        {
            string[] Proxy = File.ReadAllLines(tbProxy.Text);

            string[] UsersString = File.ReadAllLines(tbUsers.Text);


            foreach (var userString in UsersString)
            {
                if (rbBrowser.IsChecked == true)
                {
                    Random random    = new Random();
                    var    UserDick  = UsersParse.Parse(userString);
                    var    ProxyDict = ProxyParse.Parse(Proxy[random.Next(0, Proxy.Length)]);
                    logging.Invoke(LogIO.path, new Log {
                        Date = DateTime.Now, UserName = UserDick["username"], Method = "Loggining", Message = "Авторизация с браузера"
                    });
                    Mail mail;
                    logging.Invoke(LogIO.path, new Log {
                        Date = DateTime.Now, UserName = UserDick["username"], Method = "Выделение потоков", Message = "Выделение потоков"
                    });
                    try
                    {
                        mail = new Mail(UserDick["maillogin"], UserDick["mailpassword"]);
                    }
                    catch (Exception ex)
                    {
                        mail = null;
                        logging.Invoke(LogIO.path, new Log {
                            Date = DateTime.Now, UserName = UserDick["username"], Method = "Loggining", Message = Options.IsSafeAllLogsEnabled ? $"Error: {ex.Message}" : "Неудалось залогиниться на почту"
                        });
                    }
                    users.Add(new HTTPBrowser()
                    {
                        UserName      = UserDick["username"],
                        Password      = UserDick["password"],
                        ProxyUserName = ProxyDict["username"],
                        ProxyPassword = ProxyDict["password"],
                        ip            = ProxyDict["ip"],
                        port          = Int32.Parse(ProxyDict["port"]),
                        mail          = mail
                    });
                }
                else
                {
                    Random random    = new Random();
                    var    UserDick  = UsersParse.Parse(userString);
                    var    ProxyDict = ProxyParse.Parse(Proxy[random.Next(0, Proxy.Length)]);
                    Mail   mail;
                    logging.Invoke(LogIO.path, new Log {
                        Date = DateTime.Now, UserName = UserDick["username"], Method = "Выделение потоков", Message = "Выделение потоков"
                    });
                    try
                    {
                        mail = new Mail(UserDick["maillogin"], UserDick["mailpassword"]);
                    }
                    catch (Exception ex)
                    {
                        mail = null;
                        logging.Invoke(LogIO.path, new Log {
                            Date = DateTime.Now, UserName = UserDick["username"], Method = "Loggining", Message = Options.IsSafeAllLogsEnabled ? $"Error: {ex.Message}" : "Неудалось залогиниться на почту"
                        });
                    }
                    users.Add(new HTTPAndroid()
                    {
                        UserName      = UserDick["username"],
                        Password      = UserDick["password"],
                        ProxyUserName = ProxyDict["username"],
                        ProxyPassword = ProxyDict["password"],
                        ip            = ProxyDict["ip"],
                        port          = Int32.Parse(ProxyDict["port"]),
                        mail          = mail
                    });
                }
            }


            for (var i = 0; i < users.Count; i++)
            {
                workers.Add(new BackgroundWorker());
                workers[i].DoWork += new DoWorkEventHandler(InstagramTest_DoWork);
                //  workers[i].RunWorkerCompleted += InstagramTest_RunWorkerCompleted;
                workers[i].WorkerReportsProgress = true;
                workers[i].ProgressChanged      += new ProgressChangedEventHandler(bgw_ProgressChanged);
                List <Object> list = new List <object>();


                workers[i].RunWorkerAsync(users[i]);
            }



            //request = new HTTPBrowser();
            //Dictionary<string, string> parsed = ProxyParse.Parse("17t3080724:[email protected]:7951");
            //request.Login("KalkisVienna", "PULUFLbxArbR", parsed["ip"], Int32.Parse(parsed["port"]), parsed["username"], parsed["password"]);
        }