getting all tcp connections for a process like "netstat -b" in .net code

I need to write some code to determine which tcp connection(s) are opened by a particular process on the local machine.  This code will run locally on the same machine as the process that is creating the network connections.  This process is known by the executable file's name.  I need the IP address(es) that it is connecting to.  This process is a piece of middleware and is not a .net process and I do not have the source code for it.

The windows command line utility "netstat" executed with "-b" flag gives me the answer.  I'd like the .net equivalent of that.  I'd prefer not to start a command line "netstat -b" in .net code and parse the output - that is the obvious answer.
Who is Participating?
sevzasConnect With a Mentor Author Commented:
Wikipedia indicates that the windows implementation of netstat uses GetTcpTable in Ip Helper dll.

More info can be found here
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.