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; }
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>"; } }