由 訪客 » 週一 4月 20, 2009 3:00 pm
後來我在網路上找到答案了 謝謝
QList<QNetworkInterface> NetList;
int NetCount = 0;
int Neti = 0;
QString MacStr;
QNetworkInterface thisNet;
NetList = QNetworkInterface::allInterfaces();
NetCount = NetList.count();
for(Neti = 0;Neti < NetCount; Neti++)
{
if(NetList[Neti].isValid())
{
thisNet = NetList[Neti];
break;
}
}
MacStr = thisNet.hardwareAddress();