You can start with System.Net.NetworkInformation . In particular, IPGlobalProperties.GetActiveTcpConnections .
However, you will find that this library does not provide a PID, so there is no way to narrow it down by the specific process associated with each connection. I suppose it will be a lot easier to just parse the output of the netstat -ano console into a collection of managed objects and use a simple LINQ query to pull the right connections based on the process id. However, I would not recommend this if you intend to do this often, as this will be a very slow method.
You can also try PInvoke for GetExtendedTcpTable() in the DLL you mentioned above. I do not have my x64 window for testing, but it may be a simple denunciation of the specific function you are trying to call.
source share