Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. netstat

netstat

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kuniva
    wrote on last edited by
    #1

    How do i list connections in my program like Netstat does? Kuniva --------------------------------------------

    G M 2 Replies Last reply
    0
    • K Kuniva

      How do i list connections in my program like Netstat does? Kuniva --------------------------------------------

      G Offline
      G Offline
      Georg Haan
      wrote on last edited by
      #2

      Try this(NT only!): SysInternals OpenSource Tcpview http://www.sysinternals.com/ntw2k/source/tcpview.shtml Georg Haan (.NL)

      1 Reply Last reply
      0
      • K Kuniva

        How do i list connections in my program like Netstat does? Kuniva --------------------------------------------

        M Offline
        M Offline
        Masaaki Onishi
        wrote on last edited by
        #3

        Hello, the codegurus around the world.;) Accroding as Network Programming for Microsoft Windows, P548,

        The NETSTAT.EXE utility displays the TCP connection table, the UDP listener
        table, and the IPv4 ptorocol statistics on your computer. The function used
        to retrieve this information work with Windows NT 4.0 (SP 4 and later),
        Windows 98, and Windows Me.

        So, check the following functions.

        DWORD GetTcpTable (
        PMIB_TCPTABLE pTcpTable,
        PDWORD pdwSize,
        BOOL bOrder
        );

        typedef struct _MIB_TCPTABLE
        {
        DWORD dwNumEntries;
        MIB_TCPROW table[ANY_SIZE];
        } MIB_TCPTABLE, *PMIB_TCPTABLE;

        typedef struct _MIB_TCPROW
        {
        DWORD dwState;
        DWORD dwLocalAddr;
        DWORD dwLocalPort;
        DWORD dwRemoteAddr;
        DWORD dwRemoteProt;
        } MIB_TCPROW, *PMIB_TCPROW;

        DWORD GetUdpTable (...), typedef struct _MIB_UDPTALBE,
        typedef stuct _MIB_UDPROW, DWORD GetIpStatistics(...)
        typedef struct _MIB_IPSTATS...

        Good Luck.:rose: Please, don't send me your email about your questions directly. Have a nice day! Sonork - 100.10571:vcdeveloper ;)

        -Masaaki Onishi-

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups