public ExceptionForm() { NexposeAPIFetcher nexpose = new NexposeAPIFetcher(username, password); siteList = nexpose.getSites(); List <String> exceptions = new List <String>(); exceptions.Add("False Positive"); exceptions.Add("Acceptable Use"); exceptions.Add("Acceptable Risk"); exceptions.Add("Compensating Control"); InitializeComponent(); expDate.CustomFormat = "yyyy MM dd HH mm ss"; cmbExceptionType.DataSource = exceptions.ToList(); Dictionary <string, string> sortedSites = new Dictionary <string, string>(); var list = siteList.Keys.ToList(); list.Sort(); foreach (var key in list) { sortedSites.Add(key, siteList[key]); } cmbSiteSelect.DataSource = sortedSites.Keys.ToList(); cmbSiteSelect.Size = new System.Drawing.Size(220, 21); cmbSiteSelect.Refresh(); cmbExceptionType.Refresh(); expDate.Refresh(); }
public ScanForm() { var templateList = new List <string>(); //Add your templates here. replace spaces with dashes, replace dashes with underscores. templateList.Add("test-_-template"); cmbTemplate.DataSource = templateList.ToList(); cmbTemplate.AutoCompleteMode = AutoCompleteMode.SuggestAppend; cmbTemplate.AutoCompleteSource = AutoCompleteSource.ListItems; NexposeAPIFetcher nexpose = new NexposeAPIFetcher(username, password); token = nexpose.getToken(); sites = nexpose.getSites(); Dictionary <string, string> sortedSites = new Dictionary <string, string>(); var list = sites.Keys.ToList(); list.Sort(); foreach (var key in list) { sortedSites.Add(key, sites[key]); } InitializeComponent(); cmbSelectSite.DataSource = sortedSites.Keys.ToList(); cmbSelectSite.Size = new System.Drawing.Size(220, 21); dtpscanTime.Format = DateTimePickerFormat.Custom; dtpscanTime.CustomFormat = "yyyy MM dd HH mm ss"; cmbSelectSite.Refresh(); dtpscanTime.Refresh(); }
public ExceptionForm(string _username, string _password) { this.username = _username; this.password = _password; InitializeComponent(); NexposeAPIFetcher nexpose = new NexposeAPIFetcher(username, password); vulns = nexpose.getVulnerabilities(); cmbVulnTitle.DataSource = vulns.Select(f => f.title).ToList(); cmbVulnTitle.AutoCompleteSource = AutoCompleteSource.ListItems; cmbVulnTitle.AutoCompleteMode = AutoCompleteMode.SuggestAppend; siteList = nexpose.getSites(); List <String> exceptions = new List <String>(); exceptions.Add("False Positive"); exceptions.Add("Acceptable Use"); exceptions.Add("Acceptable Risk"); exceptions.Add("Compensating Control"); expDate.CustomFormat = "yyyy MM dd HH mm ss"; cmbExceptionType.DataSource = exceptions.ToList(); cmbExceptionType.AutoCompleteMode = AutoCompleteMode.SuggestAppend; cmbExceptionType.AutoCompleteSource = AutoCompleteSource.ListItems; Dictionary <string, string> sortedSites = new Dictionary <string, string>(); var list = siteList.Keys.ToList(); list.Sort(); foreach (var key in list) { sortedSites.Add(key, siteList[key]); } cmbSiteSelect.DataSource = sortedSites.Keys.ToList(); cmbSiteSelect.Size = new System.Drawing.Size(220, 21); cmbSiteSelect.Refresh(); cmbSiteSelect.AutoCompleteMode = AutoCompleteMode.SuggestAppend; cmbSiteSelect.AutoCompleteSource = AutoCompleteSource.ListItems; cmbExceptionType.Refresh(); expDate.Refresh(); }