public void ShowCaptureDialog() { TopLevelControl.Hide(); System.Threading.Thread.Sleep(500); CaptureForm c = new CaptureForm(); c.ShowDialog(); SetFocus(); Paste(); TopLevelControl.Show(); }
private void button2_Click(object sender, EventArgs e) { Int16 i = 0; ListViewItem[] temp = new ListViewItem[6]; ListViewItem tempItem = new ListViewItem(); Boolean UserNameExists = false; while (i < listView1.Items.Count) { if (textUserName.Text == listView1.Items[i].Text) UserNameExists = true; i++; } if (UserNameExists == false) { MessageBox.Show("Please select valid user name.", "Invalid User"); return; } string passwrr = "", divis = "", rights = ""; foreach (ListViewItem item in listView1.Items) { if (item.Text == textUserName.Text) { passwrr = item.SubItems[1].Text; divis = item.SubItems[2].Text; rights = item.SubItems[3].Text; } } if (textPassword.Text == passwrr) { Global.LoggedOnUser = textUserName.Text; Global.LoggedOnUserDivision= divis; Global.LoggedOnUserRights = rights; Global.loggedOnUserDivisionAbrev = divis; Global.adminOverride = false; if (systemMode == Mode.Online) Functions.WriteLog("User Log On - (" + Global.loggedOnUser + " - " + Global.loggedOnUserDivison + ")LADplus"); CaptureForm tmpMain = new CaptureForm(systemMode); tmpMain.Show(); Hide(); } else { MessageBox.Show("Invalid password. \nPlease enter correct password.\nContact your network administrator for more details.","Invalid Password"); Functions.WriteLog("Attempted User Logon (" + textUserName.Text + ")"); } }
private void newCaptureToolStripMenuItem_Click(object sender, EventArgs e) { Capture.ChooseForm frm = new Capture.ChooseForm(); Process[] processes = frm.GetSelectedProcesses(); if (processes.Length == 0) return; ProgressForm progFrm = new ProgressForm("Starting capture"); captureMgr.StartCapture(processes, progFrm); if (progFrm.ShowDialog() != DialogResult.OK) { MessageBox.Show(String.Format("Failed to start capture: {0}", progFrm.GetOperationErrorMessage()), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } Capture.ProgressForm capProgFrm = new Capture.ProgressForm(captureMgr); capProgFrm.ShowDialog(); progFrm = new ProgressForm("Stopping capture"); captureMgr.StopCapture(progFrm); if (progFrm.ShowDialog() != DialogResult.OK) { MessageBox.Show(String.Format("Failed to stop capture: {0}", progFrm.GetOperationErrorMessage()), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (saveFileDialog.ShowDialog() == DialogResult.OK) { captureMgr.SaveCapture(saveFileDialog.FileName); } else { captureMgr.DiscardCapture(); } #if false tmpEventList.Clear(); tmpPacketList.Clear(); captureStartMenuItem.Enabled = false; object source = dataGridView.DataSource; dataGridView.DataSource = null; CaptureForm frm = new CaptureForm(listener, swForm.GetRules()); frm.ShowDialog(this); dataGridView.DataSource = null; ProgressForm progFrm = new ProgressForm("Analyzing data"); Thread th = new Thread(new ParameterizedThreadStart(DoPostAnalysis)); th.Start(progFrm); progFrm.ShowDialog(this); #endif }
private void 截图CToolStripMenuItem_Click(object sender, EventArgs e) { CaptureForm c = new CaptureForm(); c.ShowDialog(); }