예제 #1
0
        public override ECheck Check()
        {
            NetworkSniffer s = null;
            try
            {
                if (!SystemHelper.IsAdministrator())
                    WriteError("Require admin rights");

                if (!DumpFolder.Exists)
                {
                    WriteError("DumpFolder must exists");
                    return ECheck.Error;
                }

                s = new NetworkSniffer(LocalAddress);
                s.Filter = new SnifferPortFilter(this.LocalPort);
                s.Start();

                return ECheck.Ok;
            }
            catch { return ECheck.Error; }
            finally
            {
                if (s != null) s.Dispose();
            }
        }
예제 #2
0
        public override bool Run()
        {
            if (!SystemHelper.IsAdministrator())
                WriteError("Require admin rights");

            if (!DumpFolder.Exists) return false;

            NetworkSniffer s = new NetworkSniffer(LocalAddress);
            s.OnTcpStream += s_OnTcpStream;
            s.Filter = new SnifferPortFilter(this.LocalPort);
            s.Start();

            CreateJob(s);
            return true;
        }