get unique host id of machine c/c++

For everyone, just starting with C++ or programming at all. Ask newbie questions in this forum!

Moderators: Darobat, RecursiveS, Dante Shamest, Bugdude, Wizard

get unique host id of machine c/c++

Postby tank junior » Sat Feb 05, 2011 7:04 am

I am looking for c/c++ code (no third party lib dependency) to get the physical address of ethernet card on mother board.

Most of them suggests to use the shell commands and process the output. For example "ipconfig /all".

There is another case when you install virtualization apps such as VirtualBox or VmPlayer, they create a virtual adepter for their own use. In that case running "ipconfig /all" returns all the adepters. (physical and virtual)

I have heard of another cases also when "ipconfig /all" return other adepters including physical one.

How do I get correct ethernet address of physical adepter only?

I am going to use this utility for license generation so it has to work correctly.


Cheers

Prashant
tank junior
 
Posts: 1
Joined: Sat Feb 05, 2011 6:56 am

Re: get unique host id of machine c/c++

Postby ventsyv » Mon Feb 07, 2011 3:38 pm

You probably need to parse through the output and somehow find the correct one. You could also have multiple network cards, so you have to figure out a way to decide which one will u be using. Using the network card address for licensing is probably not a good idea. People change those on occasion - which will invalidate their license.
User avatar
ventsyv
 
Posts: 2810
Joined: Mon Sep 22, 2003 5:25 pm
Location: MD USA


Return to For Beginners

Who is online

Users browsing this forum: No registered users and 0 guests