Advertisement
Guest User

Untitled

a guest
Feb 6th, 2018
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 11.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Threading;
  10. using System.Windows.Forms;
  11. using System.Net;
  12. using System.IO;
  13. using System.Diagnostics;
  14. using OpenQA.Selenium;
  15. using OpenQA.Selenium.Chrome;
  16. using OpenQA.Selenium.Firefox;
  17. namespace VkReg
  18. {
  19.     public partial class Form1 : Form
  20.     {
  21.         public Form1()
  22.         {
  23.             InitializeComponent();
  24.             System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls = false;
  25.         }
  26.  
  27.         private void Form1_Load(object sender, EventArgs e)
  28.         {
  29.            
  30.             string url = "https://x-autostyle.com/check.php";
  31.             var webClient = new WebClient();
  32.             var response = webClient.DownloadString(url);
  33.             if (response == "17032017")
  34.             {
  35.             }
  36.             else
  37.             {
  38.                 System.Windows.Forms.Application.Exit();
  39.             }
  40.         }
  41.  
  42.         private void register()
  43.         {
  44.  
  45.             Connect();
  46.             System.Threading.Thread.Sleep(5000);
  47.             var internet = CheckForInternetConnection();
  48.             while (internet == false)
  49.             {
  50.                 System.Threading.Thread.Sleep(1000);
  51.                 internet = CheckForInternetConnection();
  52.             }
  53.  
  54.             ChromeOptions options = new ChromeOptions();
  55.             options.AddArguments("start-maximized");
  56.             IWebDriver chrome = new ChromeDriver(options);
  57.             bool IsElementPresent(By by)
  58.             {
  59.                 try
  60.                 {
  61.                     chrome.FindElement(by);
  62.                     return true;
  63.                 }
  64.                 catch (NoSuchElementException)
  65.                 {
  66.                     return false;
  67.                 }
  68.             }
  69.             string url = "http://bysim.ru/api?api_key=eff08d0873abe7e01a5fd2511fd80315&action=getNumber&service=OTH";
  70.             var webClient = new WebClient();
  71.             var response = webClient.DownloadString(url);
  72.             var number = response.Split(':')[2];
  73.             richTextBox1.AppendText(response);
  74.  
  75.  
  76.             string[] lastnames = {
  77. "Ковалёва",
  78. "Ильина",
  79. "Гусева",
  80. "Титова",
  81. "Кузьмина",
  82. "Кудрявцева",
  83. "Баранова",
  84. "Куликова",
  85. "Алексеева",
  86. "Степанова",
  87. "Яковалева",
  88. "Сорокина",
  89. "Сергеева",
  90. "Романова",
  91. "Захарова",
  92. "Борисова",
  93. "Королева",
  94. "Герасимова",
  95. "Пономарева",
  96. "Григорьева",
  97. "Лазарева",
  98. "Медведева",
  99. "Ершова",
  100. "Никитина",
  101. "Соболева",
  102. "Рябова",
  103. "Полякова",
  104. "Цветкова",
  105. "Данилова",
  106. "Жукова",
  107. "Фролова",
  108. "Журавлева",
  109. "Николаева",
  110. "Путина",
  111. "Молчанова",
  112. "Крылова",
  113. "Максимова",
  114. "Сидорова",
  115. "Осипова",
  116. "Белоусова",
  117. "Федотова",
  118. "Дорофеева",
  119. "Егорова",
  120. "Панина",
  121. "Матвеева",
  122. "Боброва",
  123. "Дмитриева",
  124. "Калинина",
  125. "Анисимова",
  126. "Петухова",
  127. "Пугачева",
  128. "Антонова",
  129. "Тимофеева",
  130. "Никифорова",
  131. "Веселова",
  132. "Филиппова",
  133. "Романова",
  134. "Маркова",
  135. "Большакова",
  136. "Суханова",
  137. "Миронова",
  138. "Александрова",
  139. "Коновалова",
  140. "Шестакова",
  141. "Казакова",
  142. "Ефимова",
  143. "Денисова",
  144. "Громова",
  145. "Фомина",
  146. "Андреева",
  147. "Давыдова",
  148. "Мельникова",
  149. "Щербакова",
  150. "Блинова",
  151. "Колесникова",
  152. "Иванова",
  153. "Смирнова",
  154. "Кузнецова",
  155. "Попова",
  156. "Соколова",
  157. "Лебедева",
  158. "Козлова",
  159. "Новикова",
  160. "Морозова",
  161. "Петрова",
  162. "Волкова",
  163. "Соловаьева",
  164. "Васильева",
  165. "Зайцева",
  166. "Павлова",
  167. "Семенова",
  168. "Голубева",
  169. "Виноградова",
  170. "Богданова",
  171. "Воробьева",
  172. "Федорова",
  173. "Михайлова",
  174. "Беляева",
  175. "Тарасова",
  176. "Белова",
  177. "Комарова",
  178. "Орлова",
  179. "Киселева",
  180. "Макарова",
  181. "Андреева"};
  182.             string[] firstnames = {
  183. "Александра",
  184. "Саша",
  185. "Сашенька",
  186. "Юлия",
  187. "Юля",
  188. "Юльчик",
  189. "Анна",
  190. "Аня",
  191. "Анечка",
  192. "Мария",
  193. "Маша",
  194. "Машенька",
  195. "Эля",
  196. "Сюзанна",
  197. "Сюзи",
  198. "Ирина",
  199. "Ира",
  200. "Ирочка",
  201. "Василиса",
  202. "Виолетта",
  203. "Настя",
  204. "Анастасия",
  205. "Настенька",
  206. "Наташа",
  207. "Наталья",
  208. "Ната",
  209. "Полина",
  210. "Поля",
  211. "Полиночка",
  212. "Таисия",
  213. "Тая",
  214. "Ольга",
  215. "Оля",
  216. "Афина",
  217. "Алина",
  218. "Дарья",
  219. "Даша",
  220. "Варвара",
  221. "Татьяна",
  222. "Таня",
  223. "Вера",
  224. "Лиза",
  225. "Елизавета",
  226. "Алина",
  227. "Зоя",
  228. "Кристина",
  229. "Диана"};
  230.             string[] month = { "Января", "Февраля", "Марта", "Апреля", "Мая", "Июня", "Июля", "Августа", "Сентября", "Октября", "Ноября", "Декабря" };
  231.             var firstlast = firstnames[new Random().Next(0, firstnames.Length)] + " " + lastnames[new Random().Next(0, lastnames.Length)];
  232.             //var username = Transliteration.Front(firstlast.Replace(' ', '_'));
  233.             System.Drawing.Size size = new System.Drawing.Size(SystemInformation.WorkingArea.Width, SystemInformation.WorkingArea.Height);
  234.             //chrome.Manage().Window.Size = size;
  235.  
  236.             chrome.Url = "http://vk.com";
  237.             chrome.Manage();
  238.             var password = new Random().Next(100000000, 999999999);
  239.             // username = username.ToLower() + new Random().Next(1980, 1999);
  240.             chrome.FindElement(By.Id("ij_first_name")).SendKeys(firstnames[new Random().Next(0, firstnames.Length)]);
  241.             chrome.FindElement(By.Id("ij_last_name")).SendKeys(lastnames[new Random().Next(0, lastnames.Length)]);
  242.             chrome.FindElement(By.Id("dropdown1")).Click();
  243.             chrome.FindElement(By.XPath("//ul[contains(@id, 'list_options_container_1')]/li[text() =" + new Random().Next(1, 30) + "]")).Click();
  244.             chrome.FindElement(By.Id("dropdown2")).Click();
  245.             chrome.FindElement(By.XPath("//ul[contains(@id, 'list_options_container_2')]/li[text() = '" + month[new Random().Next(0, month.Length)] + "']")).Click();
  246.             chrome.FindElement(By.Id("dropdown3")).Click();
  247.             chrome.FindElement(By.XPath("//ul[contains(@id, 'list_options_container_3')]/li[text() = " + new Random().Next(1987, 1998) + "]")).Click();
  248.             System.Threading.Thread.Sleep(500);
  249.             chrome.FindElement(By.Id("ij_submit")).Click();
  250.             while (chrome.Url != "https://vk.com/join?act=finish")
  251.             {
  252.                 System.Threading.Thread.Sleep(100);
  253.             }
  254.             System.Threading.Thread.Sleep(1000);
  255.             chrome.FindElement(By.Id("join_phone")).Click();
  256.             number = number.Replace("+7", "");
  257.             chrome.FindElement(By.Id("join_phone")).SendKeys(number);
  258.             System.Threading.Thread.Sleep(500);
  259.             chrome.FindElement(By.Id("join_send_phone")).Click();
  260.             System.Threading.Thread.Sleep(2500);
  261.  
  262.             if (IsElementPresent(By.ClassName("error")))
  263.             {
  264.                 chrome.Dispose();
  265.                 register();
  266.             }
  267.             else
  268.             {
  269.                 //do if does not exists
  270.             }
  271.  
  272.             var code = "NO";
  273.             while (code == "NO")
  274.             {
  275.                 code = GetCode(response.Split(':')[1]);
  276.                 System.Threading.Thread.Sleep(2500);
  277.             }
  278.             chrome.FindElement(By.Id("join_code")).SendKeys(code);
  279.             chrome.FindElement(By.Id("join_send_code")).Click();
  280.             System.Threading.Thread.Sleep(3000);
  281.             chrome.FindElement(By.Id("join_pass")).SendKeys(password.ToString());
  282.             chrome.FindElement(By.Id("join_send_pass")).Click();
  283.             richTextBox1.AppendText(number + ":" + password.ToString());
  284.             while (chrome.Url != "https://vk.com/feed")
  285.             {
  286.                 System.Threading.Thread.Sleep(100);
  287.             }
  288.            
  289.  
  290.             System.Threading.Thread.Sleep(1000);
  291.             chrome.Navigate().GoToUrl("https://vk.com/id0");
  292.             System.Threading.Thread.Sleep(3000);
  293.             string id = chrome.Url.ToString();
  294.             id = id.Replace("https://vk.com/id", "");
  295.             Save("+7" + number + ":" + password + ";" + id);
  296.             // chrome.FindElement(By.Name("fullName")).SendKeys(firstlast);
  297.             // chrome.FindElement(By.Name("password")).SendKeys(password.ToString());
  298.             System.Threading.Thread.Sleep(15000);
  299.             chrome.Quit();
  300.             System.Threading.Thread.Sleep(3000);
  301.             register();
  302.         }
  303.  
  304.         private void button1_Click(object sender, EventArgs e)
  305.         {
  306.             Thread myThread2 = new Thread(register);
  307.             myThread2.Start(); //запускаем поток
  308.  
  309.         }
  310.  
  311.         private void richTextBox1_TextChanged(object sender, EventArgs e)
  312.         {
  313.  
  314.         }
  315.  
  316.         public string GetCode(string order)
  317.         {
  318.             string url = "http://bysim.ru/api?api_key=eff08d0873abe7e01a5fd2511fd80315&action=getStatus&id=" + order;
  319.             var webClient = new WebClient();
  320.             webClient.DownloadString(url);
  321.             var response = webClient.DownloadString(url);
  322.             if (response == "STATUS_WAIT_CODE")
  323.             {
  324.                 return "NO";
  325.             }
  326.             else
  327.             {
  328.                 if (response.Split(':')[1] == "VK")
  329.                 {
  330.                     var number = response.Split(':')[2];
  331.                     return number;
  332.                 }
  333.                 else
  334.                 {
  335.                     var number = response.Split(':')[1];
  336.                     return number;
  337.                 }
  338.  
  339.  
  340.             }
  341.  
  342.  
  343.         }
  344.  
  345.         private static void Save(string data)
  346.         {
  347.             var path = "C:/Instagram/2.txt";
  348.             StreamWriter writer = new StreamWriter(path, true, Encoding.GetEncoding("windows-1251"));
  349.             writer.Write(data + Environment.NewLine);
  350.             writer.Close();
  351.         }
  352.  
  353.         public static bool CheckForInternetConnection()
  354.         {
  355.             try
  356.             {
  357.                 using (var client = new WebClient())
  358.                 {
  359.                     using (client.OpenRead("http://clients3.google.com/generate_204"))
  360.                     {
  361.                         return true;
  362.                     }
  363.                 }
  364.             }
  365.             catch
  366.             {
  367.                 return false;
  368.             }
  369.         }
  370.  
  371.         private void Connect()
  372.         {
  373.             const string strCmdText = "/C rasdial /d&&ping -n 3 127.0.0.1 > nul&&rasdial \"MTS-Internet\" /callback:*99#";
  374.             Process.Start("CMD.exe", strCmdText);
  375.         }
  376.     }
  377. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement