Hi all Experts,
I am trying to find the hardware address of my PC.
I used QNetworkInterface class but i am getting my hardware address BLANK.
Please give me a hint to do so.
Hi all Experts,
I am trying to find the hardware address of my PC.
I used QNetworkInterface class but i am getting my hardware address BLANK.
Please give me a hint to do so.
Thanks & Regards ,
Vajindar Laddad .
Trainee Developer.
(INDIA).
91+9325014248
how do you get an address?
show us code.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Hi ,
QNetworkInterface interface;
QString hAddress = interface.hardwareAddress();
I am new to QtNetworking , I may be wrong.
Please help .
Thanks & Regards ,
Vajindar Laddad .
Trainee Developer.
(INDIA).
91+9325014248
works fine for me
Qt Code:
qDebug() << ni.hardwareAddress();To copy to clipboard, switch view to plain text mode
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
I have used the code like this
I am gettingQNetworkInterface interface;
QList<QNetworkInterface> networkList;
networkList = interface.allInterfaces();
for(int i=0;i<networkList.count();i++)
{
QMessageBox::information(this,"Network Interface",networkList.at(i).hardwareAddress());
}
1) 00:00:00:00:00:00
2) 00:1E:2A:44:8A:34
3) 00:1E:2A:44:8A:34
4) 00:21:9B:0B:0A:E4
5) B2:4F:AC:1D:5B:EB
6) 56:47:C1:83:9A:52
Is this correct what i am getting ?
Thanks & Regards ,
Vajindar Laddad .
Trainee Developer.
(INDIA).
91+9325014248
yes, it is.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
vajindarladdad (12th November 2009)
BTW, in Qt land, foreach is easier than the equivalent structure using a standard C for loop
Look at spirit's code and yours. spirit's is much easier to read and follow. Why write more code when the compiler will do it for you?
vajindarladdad (12th November 2009)
Bookmarks