|
-
Feb 2nd, 2000, 11:07 PM
#1
Thread Starter
Junior Member
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.
-
Feb 3rd, 2000, 09:42 PM
#2
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).]
-
Feb 3rd, 2000, 11:37 PM
#3
Thread Starter
Junior Member
What I mean now is using VB to write a program to check a windows 9*, not in unix
-
Feb 4th, 2000, 04:42 PM
#4
Fanatic Member
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?
-
Feb 5th, 2000, 08:47 PM
#5
Addicted Member
try starting the command.com with ShellExecute and pass the netstat thing as parameter!
------------------
Razzle
ICQ#: 31429438
-
Feb 5th, 2000, 11:38 PM
#6
Fanatic Member
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?
-
Feb 8th, 2000, 02:35 PM
#7
Thread Starter
Junior Member
can i read the data from a text file from VB program after a text file is generated by netstat?
How to do that??
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|