Ejemplo n.º 1
0
        private void LoadFileButton_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog openFileDialog = new OpenFileDialog())
            {
                openFileDialog.InitialDirectory = "c:\\";
                openFileDialog.Filter           = "pcap | *.pcap";
                openFileDialog.FilterIndex      = 1;
                openFileDialog.RestoreDirectory = true;

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    var capFile = openFileDialog.FileName;
                    try
                    {
                        var device = new CaptureFileReaderDevice(capFile);
                        //device.Open();
                        _reader.SetDevice(device);
                        var frm = new MapForm
                        {
                            Location      = Location,
                            StartPosition = FormStartPosition.Manual
                        };
                        frm.FormClosing += delegate { Show(); };
                        frm.Show();
                        Hide();
                    }
                    catch (Exception exc)
                    {
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void MapButton_Click(object sender, EventArgs e)
        {
            var frm = new MapForm
            {
                Location      = Location,
                StartPosition = FormStartPosition.Manual
            };

            frm.FormClosing += delegate { Show(); };
            frm.Show();
            Hide();
        }
Ejemplo n.º 3
0
        private void SelectInterface(object sender, EventArgs e)
        {
            var index = InterfacesList.SelectedIndex;

            _reader.SetDevice(index);
            var frm = new MapForm
            {
                Location      = Location,
                StartPosition = FormStartPosition.Manual
            };

            frm.FormClosing += delegate { Show(); };
            frm.Show();
            Hide();
        }