Results 1 to 7 of 7

Thread: Check my own port status

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    17

    Post

    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.

  2. #2
    Guest

    Post

    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).]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    17

    Post

    What I mean now is using VB to write a program to check a windows 9*, not in unix

  4. #4
    Fanatic Member invitro's Avatar
    Join Date
    Jan 2000
    Location
    Outside your window
    Posts
    547

    Post

    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?

  5. #5
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161

    Post

    try starting the command.com with ShellExecute and pass the netstat thing as parameter!

    ------------------
    Razzle
    ICQ#: 31429438

  6. #6
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Post

    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?


  7. #7

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    17

    Post

    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
  •  



Click Here to Expand Forum to Full Width