Esempio n. 1
0
        public TcpRow(TcpRow tcpRow)
        {
            this.LocalAddress = tcpRow.LocalAddress;
            this.LocalPort    = tcpRow.LocalPort;

            this.RemoteAddress = tcpRow.RemoteAddress;
            this.RemotePort    = tcpRow.RemotePort;

            this.State     = tcpRow.State;
            this.ProcessId = tcpRow.ProcessId;

            this.Protocol = tcpRow.Protocol;
        }
Esempio n. 2
0
        public TcpRowEx(TcpRow tcpRow) : base(tcpRow)
        {
            try
            {
                switch (ProcessId)
                {
                case 0:
                    ProcessName = "<System Idle>";
                    break;

                case 4:
                    ProcessName = "<System>";
                    break;

                default:
                    ProcessName = Process.GetProcessById(ProcessId).MainModule.ModuleName;
                    break;
                }
            }
            catch
            {
                ProcessName = "<access denied>";
            }
        }