public Subscribe(IWebDriver driver, ControlFormProgramm controlFormProgramm) { _driver = driver; _controlFormProgramm = controlFormProgramm; _running = new Running(_driver, _controlFormProgramm); }
public Form1() { ChromeOptions options = new ChromeOptions(); options.AddArguments("window-size=1800x1080"); options.AddArguments("--disable-gpu"); options.AddArguments("--disable-extensions"); options.AddArguments("--max_old_space_size=512"); options.AddArguments("--start-maximized"); options.AddArguments("--no-sandbox"); options.AddArguments("--disable-dev-shm-usage"); options.AddArguments("--headless"); // var dir_chrome_browser = Directory.GetCurrentDirectory() + "\\Chrome\\Application1\\chrome.exe"; // options.BinaryLocation = dir_chrome_browser; //options.AddArguments("start-maximized"); // open Browser in maximized mode //options.AddArguments("disable-infobars"); // disabling infobars //options.AddArguments("--disable-extensions"); // disabling extensions //options.AddArguments("--disable-gpu"); // applicable to windows os only //options.AddArguments("--disable-dev-shm-usage"); // overcome limited resource problems //options.AddArguments("--no-sandbox"); // Bypass OS security model // web = new ChromeDriver(@"D:/"); var dir_chrome_driver = Directory.GetCurrentDirectory() + "\\lib"; ChromeDriverService service = ChromeDriverService.CreateDefaultService(dir_chrome_driver); service.HideCommandPromptWindow = true; try { web = new ChromeDriver(service, options); } catch (Exception e) { MessageBox.Show("Убедитесь в наличии браузера Google Chrome версии 72.0 и выше \nОшибка инициализации браузера, доступ запрещен или объект отстуствует. \n" + e.Message, "Error, Google Chrome!", MessageBoxButtons.OK, MessageBoxIcon.Error); } web.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10); _authenticator = new Authenticator(web, new ControlFormProgramm(this)); _like = new Like(web, new ControlFormProgramm(this)); _subscribe = new Subscribe(web, new ControlFormProgramm(this)); _сontrolFormProgramm = new ControlFormProgramm(this); _securityKey = new SecurityKey(); _regEdit = new RegEdit(); _props = new Props(this); _autoRun = new AutoRun(); this.Icon = Resources.instagramico; MyGlavForm = this; InitializeComponent(); progressBar1.Style = ProgressBarStyle.Continuous; progressBar1.Maximum = 100; progressBar1.Value = 0; _сontrolFormProgramm.FirstStateProgramm(); label3.Text = "Войдите в свой инстаграмм профиль .."; this.MaximumSize = new System.Drawing.Size(690, 560); this.MinimumSize = new System.Drawing.Size(690, 560); }
public Running(IWebDriver driver, ControlFormProgramm controlFormProgramm) { _driver = driver; _controlFormProgramm = controlFormProgramm; }
public static int accountIsLoggedIn; //использовать потом public Authenticator(IWebDriver driver, ControlFormProgramm controlFormProgramm) { _driver = driver; _controlFormProgramm = controlFormProgramm; }