1、先通过C:\Users\awflasher>netstat -ao 查看那端口对应的pid
Local Address Foreign Address State PID TCP
TCP 0.0.0.0:21 Pacers:0 LISTENING 511
TCP 0.0.0.0:80 Pacers:0 LISTENING 6421
看了看netstat的帮助,分别如此描述-a和-o,也就明白了: -a Displays all connections and listening ports.
-o Displays the owning process ID associated with each connection
2、用tasklist的FILTER,我们可以很快找到这个进程:C:\Users\awflasher>tasklist /FI "PID eq 6421"
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
MxDownloadServer.exe 6421 Console 1 7,980 K
这样就找到该端口对应的是那个程序了