原文:C#如何检测网络端口连接的状态 C#如何检测/监控远程连接网络端口的情况(例如:3389端口是否处于监听状态,是否建立了连接等). using System; using System.Collections.Generic; using System.Text; using System.Net.NetworkInformation; namespace test { class Program { static void Main(string[] ar…
转自:http://stackoverflow.com/questions/808560/how-to-detect-the-physical-connected-state-of-a-network-cable-connector You want to look at the nodes in /sys/class/net/ I experimented with mine: Wire Plugged in: eth0/carrier:1eth0/operstate:unknown Wire…