Reading current connections
Posted on 2003-03-27
I need to read a PCs current connections, something like the DOS command NETSTAT does...
At the moment, I'm using
Shell("command.com /c " & "netstat -> " & Chr(34) & AppPath & "netstat.txt" & Chr(34), vbHide)
and then reading this information into memory, extracting the data with a couple of basic IFs and Right()s etc
However I'm sure there is an easier way!
The information I need to extract is:
1) The resolved DNS (not ip) address
2) The local port used
3) If the connection is currently established (ie not SYN_SENT or CLOSE_WAIT as it says in NETSTAT)