根据指定进程得到端口

tasklist
得到指定进程的pid

netstat -ano
得到指定pid的端口

原文地址:https://www.cnblogs.com/wangbiwei/p/5744416.html