Netstat -ban (or -oan) equivalent in .NET.

I would like to know if a particular process uses this port, i.e. netstat -ban. I came across using IPGlobalPropertiesto get a list of active connections, but this does not seem to include process information.

It would be nice if in C # there is some class that allows me to do this programmatically. Ideally, I would not need to output the cmd shell output Process.

+3
source share
1 answer

Please read this question ...

What PID is listening on this port in C #

Basically you are PInvoke GetExtendedTcpTable ()

+3
source

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


All Articles