Click to See Complete Forum and Search --> : Check my own port status
soesmy
Feb 2nd, 2000, 10:07 PM
How to write a program to check my own sockets/ports to know that which port/ socket
is connect to others surver and retrive the server info too???
The process is not creating new ports, just check whether any ports have been created only.
You could do it by shelling a program called 'netstat' and parse the output.
It will show all active connection from you, listening and established
Use netstat -a to retreive all info
You could shell it netstat -a >netstat.txt and then parse netstat.txt for all active connections.
------------------
Vincent van den Braken
EMail: azzmodan@azzmodan.demon.nl
ICQ: 15440110 (http://www.icq.com/15440110)
Homepage: http://www.azzmodan.demon.nl
[This message has been edited by Azzmodan (edited 02-04-2000).]
soesmy
Feb 3rd, 2000, 10:37 PM
What I mean now is using VB to write a program to check a windows 9*, not in unix
invitro
Feb 4th, 2000, 03:42 PM
Yeah thats what Azzmodan means..
netstat is a command in windows that does it for you. with the > parameter, u can make it write to a file.
Write this code
VARIABLE = Shell("netstat -a >c:\temp.txt")
This should work, but it dosent for me.
When i run that procedure, MSDOS opens, and tells me ive put invalid parameters in. But when i type in the exact thing in MSDOS it works!!!!
Anybody got any suggestions?
Razzle
Feb 5th, 2000, 07:47 PM
try starting the command.com with ShellExecute and pass the netstat thing as parameter!
------------------
Razzle
ICQ#: 31429438
Paul282
Feb 5th, 2000, 10:38 PM
I had problems with this very thing but I was in a hurry so I stuck the command in a .bat file and called it minimised. I use C++ for consol apps now and this sort of stuff is a little embarressing. but I've seen bugger-all documentation for networking API !!!
anyone know any net API tutorial links?
soesmy
Feb 8th, 2000, 01:35 PM
can i read the data from a text file from VB program after a text file is generated by netstat?
How to do that??
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.