/// <summary> /// Initialize Web structure. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private async void btnInitWebStrucure_Click(object sender, EventArgs e) { if (!txtRootWP.Text.StartsWith("http")) { txtRootWP.Text = "http://" + txtRootWP.Text + "/"; } groupInit.Enabled = false; try { WebStructureOptions options = new WebStructureOptions() { RootWebsite = txtRootWP.Text, MaxHostCount = Convert.ToInt32(numMaxHosts.Value), MaxSubpages = Convert.ToInt32(numMaxSubPages.Value), TorClientDirectory = Path.Combine(Application.StartupPath, "Tor Files"), includeClearWeb = checkClearNet.Checked, includeIpHosts = checkIpHosts.Checked , maxQueue = Convert.ToInt32(numMaxQueue.Value), }; switch (cbArch.Text) { case "x86": options.is32bit = true; break; case "x64": options.is32bit = false; break; default: break; } webStructure = new WebStructure(options); webStructure.EventResponse += WebStructure_EventResponse; await webStructure.InitAsync(); } catch (Exception ex) { groupInit.Enabled = true; LogSync(ex.Message, "ERROR"); } }
private void resetAll() { try { time.Stop(); stopWatch = null; webStructure.RequestCrawlCancellation(); webStructure = null; groupInit.Visible = true; toolBar.Enabled = false; groupInit.Enabled = true; lblHostCount.Text = "0"; lblQueuedLinks.Text = "0"; lblTotalCount.Text = "0"; listHosts.Items.Clear(); listQueuedUrls.Items.Clear(); } catch { } LogSync("Layout reset."); }