DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Lokesh Guest

    How to get Mac address of a Windows machine?


    Folks,
    I have IP address of a Windows (95/98/NT/2K) machine. How do I get mac address
    of the same machine. Any method is OK. Please, throw all the methods you
    know
    from your experience.

    Hoping for an early response,
    Lokesh

  2. #2
    john chapman Guest

    Re: How to get Mac address of a Windows machine?


    "Lokesh" <klokesh@mailexcite.com> wrote:
    >
    >Folks,
    >I have IP address of a Windows (95/98/NT/2K) machine. How do I get mac address
    >of the same machine. Any method is OK. Please, throw all the methods you
    >know
    >from your experience.
    >
    >Hoping for an early response,
    >Lokesh


    Checkout article Q118623 (via MSDN etc)

  3. #3
    Nilabja Roy Guest

    Re: How to get Mac address of a Windows machine?


    Hello

    I have a method ..this will give u the host name when u supply the ip address.
    eg suppoxe u give xxx.xx.x.xxx u get www.xxx.com

    Use the code given below ... i have not enclosed error correction u can use
    that ....

    WORD wVersionRequested;
    WSADATA wsaData;
    wVersionRequested = MAKEWORD( 2, 2 );

    WSAStartup( wVersionRequested, &wsaData );

    long ad = inet_addr("xxx.xx.x.xxx" /*here u insert the ip add*/);

    HOSTENT * host = gethostbyaddr((const char*)&ad , 4 , AF_INET );

    cout << host->h_name << endl; // will give u the host name

    I hope this works ..thanks

    nilabja



  4. #4
    Nilabja Roy Guest

    Re: How to get Mac address of a Windows machine?


    Hello

    I have a method ..this will give u the host name when u supply the ip address.
    eg suppoxe u give xxx.xx.x.xxx u get www.xxx.com

    Use the code given below ... i have not enclosed error correction u can use
    that ....

    WORD wVersionRequested;
    WSADATA wsaData;
    wVersionRequested = MAKEWORD( 2, 2 );

    WSAStartup( wVersionRequested, &wsaData );

    long ad = inet_addr("xxx.xx.x.xxx" /*here u insert the ip add*/);

    HOSTENT * host = gethostbyaddr((const char*)&ad , 4 , AF_INET );

    cout << host->h_name << endl; // will give u the host name

    WSACleanup();
    I hope this works ..thanks

    nilabja



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links