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.
Printable View
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: [email protected]
ICQ: 15440110
Homepage: http://www.azzmodan.demon.nl
[This message has been edited by Azzmodan (edited 02-04-2000).]
What I mean now is using VB to write a program to check a windows 9*, not in unix
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?
try starting the command.com with ShellExecute and pass the netstat thing as parameter!
------------------
Razzle
ICQ#: 31429438
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?
can i read the data from a text file from VB program after a text file is generated by netstat?
How to do that??