Пример #1
0
 private void btnSniffer_Click(object sender, EventArgs e)
 {
     if (cbDevice.SelectedIndex == -1)
     {
         MessageBox.Show("You need to select device first.");
         return;
     }
     if (Convert.ToInt32(btnSniffer.Tag) == 0)
     {
         btnSniffer.Text        = "Stop";
         btnSniffer.Image       = Resources.stop;
         btnSniffer.Tag         = 1;
         cbDevice.Enabled       = false;
         tmrRefreshList.Enabled = false;
         PcapHelper.StartSniffing((cbDevice.SelectedItem as ComboboxItem));
     }
     else
     {
         PcapHelper.StopSniffing();
         btnSniffer.Text        = "Start";
         btnSniffer.Image       = Resources.start;
         btnSniffer.Tag         = 0;
         cbDevice.Enabled       = true;
         tmrRefreshList.Enabled = true;
     }
 }
Пример #2
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     lblVersion.Text        = $"Version: {Application.ProductVersion}";
     tmrRefreshList.Enabled = true;
     mapControl.MapProvider = GMapProviders.YandexMap;
     mapControl.ScaleMode   = ScaleModes.Fractional;
     mapControl.MinZoom     = 0;
     mapControl.MaxZoom     = 24;
     mapControl.Zoom        = 2;
     mapControl.Overlays.Add(mapOverlays);
     PcapHelper.CurrentAppForm = this;
     PcapHelper.FillDeviceDropDownList(cbDevice);
     gvRecords.DataSource = PcapHelper.PacketDataSource;
     if (VisualizationHelper.CheckData(ref settings))
     {
         gvGrid.Columns.Clear();
         gvGrid.DataSource = VisualizationHelper.GridSource;
         VisualizationHelper.UpdateMarkers(mapOverlays);
     }
     //for now until al bugs are fixed, I'll hide it, and settings menu button too
     tcMain.TabPages.Remove(tabPacketSniffer);
     mnuSettings.Visible = false;
 }