Results 1 to 2 of 2

Thread: MAC Address

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    93
    Anyone got any code for retrieving a MAC address for a network card?

    I have been using the code posted at VBNet and Microsoft however I have noticed that unless the network card is physically plugged into the LAN then it returns zero values for the address. It seems to happen using Win98 and Win2000. WinNT4 is fine.

    If anyone has any fail save methods for returning the correct MAC let me know.

    I am using the MAC for software licensing purposes.

  2. #2
    Hyperactive Member
    Join Date
    May 1999
    Location
    Sunny Southern Weather
    Posts
    406
    See the attached file -it's the only way I know how to do it and it works on NT and win2K.
    Basically, I call ipconfig /all then parse it for the address.

    I wrote this a while ago, so I dump the ipconfig results to a file then parse that.

    If you come up with a simple way to do it without the file, let me know.
    (I haven't touched this code in a long time...)

    This will give you the Physical Address of the nic card.
    Attached Files Attached Files

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