Find application using port

I have a network program setup that does a lot of what nestat does. I am currently working on netstat -o. This command will give me the PID of the program using this socket. I have an idea of ​​where to look. I am trying to use WMI to get this information, but so far I have not found a suitable class.

How to find the PID or name of an application that uses a specific socket?

I am using c #

+3
source share
2 answers

AFAIK, this information is not displayed anywhere in BCL or WMI. You will need p / Invoke GetExtendedTcpTable to get it.

+2
source

Source: https://habr.com/ru/post/1753016/


All Articles