I am attempting to obtain mac address on windows xp using this code:
QString getMacAddress()
{
QString macaddress=\"??:??:??:??:??:??\";
#ifdef Q_WS_WIN
PIP_
With Qt and the QtNetwork module, you can get one of the MAC addresses like that:
QString getMacAddress()
{
foreach(QNetworkInterface netInterface, QNetworkInterface::allInterfaces())
{
// Return only the first non-loopback MAC Address
if (!(netInterface.flags() & QNetworkInterface::IsLoopBack))
return netInterface.hardwareAddress();
}
return QString();
}