开发者

How do I find out what process opened what port?

开发者 https://www.devze.com 2023-03-29 14:55 出处:网络
I want a method of finding out what process opened what port without the aid of an external application. I.e. no netstat or other tools like 开发者_如何学Pythonit.You need to use the IP helper functio

I want a method of finding out what process opened what port without the aid of an external application. I.e. no netstat or other tools like 开发者_如何学Pythonit.


You need to use the IP helper functions. More specifically GetExtendedTcpTable and GetExtendedUdpTable.

For example, for GetExtendedUdpTable, you can pass in MIB_UDPTABLE_OWNER_PID as the TableClass and you will be able to receive the PID of the process that issued the call to bind for the UDP endpoint.

0

精彩评论

暂无评论...
验证码 换一张
取 消