private void result_view_PreviewMouseDoubleClick(object sender, MouseButtonEventArgs e) { if (result_view.SelectedItem == null) { return; } Exploit exp = result_view.SelectedItem as Exploit; Process.Start(string.Format("http://www.exploit-db.com/exploits/{0}", exp.ID)); }
private void MenuItem_Click(object sender, RoutedEventArgs e) { if (result_view.SelectedItem == null) { return; } Exploit exp = result_view.SelectedItem as Exploit; exploit_id_text.Text = exp.ID.ToString(); exploit_id_text.Tag = exp.Path; tabControl.SelectedItem = tabControl.Items[1]; script_make_Click(null, null); }
private void search_btn_Click(object sender, RoutedEventArgs e) { search_btn.IsEnabled = false; result_view.Items.Clear(); string sql_where = string.Format("description like '%{0}%'", search_text.Text); string platform_str = platform_box.SelectedItem.ToString(); if (platform_str != "All") { sql_where += string.Format(" and platform='{0}'", platform_str); } string type_str = type_box.SelectedItem.ToString(); if (type_str != "All") { sql_where += string.Format(" and type='{0}'", type_str); } DataRow[] result = ExploitManager.ExploitTable.Select(sql_where, "date desc"); if (result.Length == 0) { MessageBox.Show("Not found."); } foreach (var item in result) { Exploit exp = new Exploit(); exp.Name = item["description"].ToString(); exp.Date = string.Format("{0:d}", item["date"]); exp.PlatformType = string.Format("{0},{1}", item["platform"], item["type"]); exp.Port = Convert.ToInt32(string.IsNullOrEmpty(item["port"].ToString()) ? 0 : item["port"]); exp.ID = Convert.ToInt32(item["id"]); exp.Path = Convert.ToString(item["file"]); result_view.Items.Add(exp); } status_txt.Text = string.Format("Results: {0}", result.Length); search_btn.IsEnabled = true; }