Esempio n. 1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void DGV_CurrentCellDirtyStateChanged(object sender, EventArgs e)
 {
     if (DGV_Targets.IsCurrentCellDirty)
     {
         DGV_Targets.CommitEdit(DataGridViewDataErrorContexts.Commit);
     }
 }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DGV_Targets_MouseUp(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         try
         {
             DataGridView.HitTestInfo hti = DGV_Targets.HitTest(e.X, e.Y);
             if (hti.RowIndex >= 0)
             {
                 CMS_ManageTargets.Show(DGV_Targets, e.Location);
             }
         }
         catch (Exception) { }
     } // if (e.Bu...
 }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DGV_Targets_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                DataGridViewRow lCurrentRow = DGV_Targets.SelectedRows[0];
                String          lIP         = lCurrentRow.Cells["IP"].Value.ToString();
                String          lMAC        = lCurrentRow.Cells["MAC"].Value.ToString();
                String          lVendor     = lCurrentRow.Cells["vendor"].Value.ToString();

                SystemFingerprint.SystemFingerprint lFingerprint = new SystemFingerprint.SystemFingerprint(lMAC, lIP, lVendor);
                lFingerprint.ShowDialog();
                reloadDGVValues();
            }
            catch (Exception lEx)
            {
                LogConsole.Main.LogConsole.pushMsg(String.Format("ARPScan: {1}", lEx.Message));
                DGV_Targets.ClearSelection();
            }
        }
Esempio n. 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DGV_Targets_MouseDown(object sender, MouseEventArgs e)
        {
            try
            {
                DataGridView.HitTestInfo hti = DGV_Targets.HitTest(e.X, e.Y);

                if (hti.RowIndex >= 0)
                {
                    DGV_Targets.ClearSelection();
                    DGV_Targets.Rows[hti.RowIndex].Selected = true;
                    DGV_Targets.CurrentCell = DGV_Targets.Rows[hti.RowIndex].Cells[0];
                }
            }
            catch (Exception lEx)
            {
                LogConsole.Main.LogConsole.pushMsg(String.Format("ARPScan: {1}", lEx.Message));
                DGV_Targets.ClearSelection();
            }
        }
Esempio n. 5
0
        private void setARPScanBTOnStopped()
        {
            if (InvokeRequired)
            {
                BeginInvoke(new setARPScanBTOnStoppedDelegate(setARPScanBTOnStopped), new object[] { });
                return;
            }


            /*
             * Set GUI parameters
             */
//      DGV_Targets.Enabled = true;
            BT_Close.Enabled    = true;
            BT_Scan.Enabled     = true;
            RB_Netrange.Enabled = true;
            RB_Subnet.Enabled   = true;

            if (RB_Netrange.Checked)
            {
                TB_Netrange1.ReadOnly = false;
                TB_Netrange2.ReadOnly = false;

                TB_Netrange1.Enabled = true;
                TB_Netrange2.Enabled = true;
            }

            this.Cursor        = Cursors.Default;
            DGV_Targets.Cursor = Cursors.Default;

            /*
             * Set the tool tips!
             */
            foreach (DataGridViewRow lTmpRow in DGV_Targets.Rows)
            {
                foreach (DataGridViewCell lTmpCell in lTmpRow.Cells)
                {
                    try
                    {
                        lTmpCell.ToolTipText = lTmpRow.Cells["Note"].Value.ToString();
                    }
                    catch (Exception) { }
                } // foreach (Dat...
            }     // foreach (Dat...

            DGV_Targets.Refresh();

            /*
             * Stop ARP scan. First the regular, then the brute way.
             */
            try
            {
                cTaskARPScan.stopARPScan();
            }
            catch (Exception lEx)
            {
                LogConsole.Main.LogConsole.pushMsg(String.Format(lEx.StackTrace));
            }

            try
            {
                cTaskARPScan.killAllRunningARPScans();
            }
            catch { }
        }