private void btnStart_Click(object sender, EventArgs e) { if (String.IsNullOrEmpty(this.tbUrl.Text)) { MessageBox.Show("You need to enter url!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (!this.AtLeastOneCheckSelected()) { MessageBox.Show("You must select at least one check!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } this.gvResults.DataSource = null; this.ClearResponseSummary(); this._juniperManager = new JuniperManager(this.GetBaseUrl()); this._scannerSetting = new ScannerSetting { MinId = ( int )this.nudMin.Value, MaxId = ( int )this.nudMax.Value, CheckMultipleSignInPages = this.chbMultipleSignInPages.Checked, CheckWebRoot = this.chbWebRoot.Checked, CheckSetupFiles = this.chbSetupFiles.Checked, CheckAuthByPass = this.chbAuthByPass.Checked, CheckXssVulnerability = this.chbCheckXss.Checked, CheckAdminAccess = this.chbAdminAccess.Checked, CheckMeetingTest = this.chbMeetingTest.Checked }; this.ActivateStatusLabel(true); this.DisableControls(this.Controls, false); this.bgWorker.RunWorkerAsync(); }
private void btnStop_Click(object sender, EventArgs e) { this.bgWorker.CancelAsync(); MessageBox.Show("Scanning aborted!", String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information); this.btnStop.Enabled = false; this.ActivateStatusLabel(false); this.ClearResponseSummary(); this.gvResults.DataSource = null; this._juniperManager.Dispose(); this._juniperManager = null; this.DisableControls(this.Controls, true); }
private void ExportScanningResults() { if (JuniperManager.ResponseDetails == null) { MessageBox.Show("There are nothing to export!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } using (var dialog = new SaveFileDialog()) { dialog.Filter = "Text Files (*.txt)|*.txt"; if (dialog.ShowDialog(this).Equals(DialogResult.OK)) { File.AppendAllText(dialog.FileName, JuniperManager.GetResultForExport()); MessageBox.Show("Results have been successfully exported!", String.Empty, MessageBoxButtons.OK, MessageBoxIcon.Information); } } }