Link to home
Start Free TrialLog in
Avatar of rjdown
rjdownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Reading current connections

Hi!

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
and
3) If the connection is currently established (ie not SYN_SENT or CLOSE_WAIT as it says in NETSTAT)

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of gepi
gepi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rjdown

ASKER

:O well I did ask for an EASIER way lol..
Avatar of rjdown

ASKER

:O well I did ask for an EASIER way lol..
Avatar of rjdown

ASKER

ahh cmon there MUST be a way without all this code :(
Avatar of rjdown

ASKER

hmm

well I followed the link you gave, and managed to find some suitable code. Thanks :)
Avatar of gepi
gepi

For nothing :)