Thread: Getting HOSTnames/IPs of all computers in same Network neighbourhood??

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    114

    Getting HOSTnames/IPs of all computers in same Network neighbourhood??

    simple question:


    as the topic : how do i go about Getting HOSTnames/IPs of all computers in same "Network neighbourhood"??

    2. and in the same "entire network"

    which API do i use??
    i searched the winsock SDK section in msdn.com but cant find the API needed

    i dun use MFC btw

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You can use the WNetEnumResource() function to list the contents of "Network Neighbourhood" A nice sample can be found at http://win32.mvps.org/network/wnoe_wner.html

    Alternative approaches could use NetServerEnum() or NetQueryDisplayInformation().

    All these functions return computer names which can be resolved to ip addresses with gethostbyname() or getaddrinfo().

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Numeric addresses for computers
    By great in forum C Programming
    Replies: 4
    Last Post: 08-23-2010, 11:53 AM
  2. Replies: 2
    Last Post: 05-13-2009, 12:57 PM
  3. Computers as authors
    By hk_mp5kpdw in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 11-22-2004, 08:55 PM
  4. limiting the bandwidth of computers on my network
    By Xterria in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 07-14-2004, 05:58 PM
  5. network 2 computers
    By actionbasti in forum Networking/Device Communication
    Replies: 2
    Last Post: 11-10-2003, 09:57 AM