Esempio n. 1
0
 private void mBtnOpenFolder_Click(object sender, EventArgs e)
 {
     System.Diagnostics.Process.Start(FileStoragePath.GetPath_MainFolder());
 }
Esempio n. 2
0
        private void mBtnSelectPacketFile_Click(object sender, EventArgs e)
        {
            mOpenFileDialog.Title            = "Select file";
            mOpenFileDialog.Multiselect      = true;
            mOpenFileDialog.Filter           = "Pcap files (*.pcap)|*.pcap|Pcapng files (*.pcapng)|*.pcapng";
            mOpenFileDialog.InitialDirectory = Directory.GetCurrentDirectory() + "//" + FileStoragePath.GetPath_MainFolder() + "//";
            //mOpenFileDialog.Filter = "Pcap |*.pcap | Pcapng |*.pcapng";
            ReadPacpFile PacketFileReader = new ReadPacpFile(mReadFileProgressBar);

            if (mOpenFileDialog.ShowDialog() == DialogResult.OK)
            {
                List <string> fileNames = new List <string>();
                foreach (string filename in mOpenFileDialog.FileNames)
                {
                    fileNames.Add(filename);
                }
                if (!PacketFileReader.OpenFile(fileNames))
                {
                    MessageBox.Show("Open File Fail");
                    return;
                }
            }
            else
            {
                return;
            }


            PacketFileReader.PackerHandler = new PackerHandler(ReadPacketFileHandler);
            mPacketTrace.Items.Clear();
            SIPTrace              = new SIPTRACE();
            SSLTrace              = new SSLTracer(FileStoragePath.GetPath_TotalPackets());
            listIPTrace           = new List <IPTraceInfo>();              // new a IPTrace List
            PacketQueue           = new Queue <RawCapture>();              // new a PacketQueue
            trdGetPacketFromQueue = new Thread(GetPacketFromQueue);        // Start thread to get packet from queue and then analyze.
            trdUpdateListUI       = new Thread(UpdateListUI);              // Stert thread to update list UI.
            Thread SipThread = new Thread(SipProcess);

            trdGetPacketFromQueueAct = true;                               // Used to control GetPacketFromQueue thread to stop whem it's false
            trdUpdateListUIAct       = true;
            Status = EnumStatus.OpenFile;
            PacketFileReader.Start();
            trdGetPacketFromQueue.Start();
            trdUpdateListUI.Start();
            SipThread.Start();
            TotalPacketStream   = 0;
            mStatusStreams.Text = "Total Streams(Byte) : 0     ";
            this.Text           = "Packets Monitor ( Open File )";
            mStatusMonitor.Text = "Status : Open File...     ";
        }