
Originally Posted by
genny77
Hi,
I know that Ethernet Card 's Mac Address can be changed.
Now I have a question:
Through the function QNetworkInterface::hardwareAddress () we can obtain the native Mac Address or the Mac Address modified?
Thanks
Gennaro
before i launch mysql connecto from external server i check network ...
&& it return forever the actual status....
/* if external network is up? */
static inline bool NetworkEnable() {
bool validip = false;
int o = -1;
o++;
QString mach
= hop.
hardwareAddress();
if (!oneip.contains("127.")) {
bool actual = hop.isValid();
if (actual) {
validip = true;
}
}
}
return validip;
}
/* if external network is up? */
static inline bool NetworkEnable() {
bool validip = false;
QList<QHostAddress> addrlist = QNetworkInterface::allAddresses();
int o = -1;
foreach(QHostAddress addr, addrlist){
o++;
QNetworkInterface hop = QNetworkInterface::interfaceFromIndex(o);
QString mach = hop.hardwareAddress();
QString name = hop.name();
QString oneip = addr.toString();
if (!oneip.contains("127.")) {
bool actual = hop.isValid();
if (actual) {
validip = true;
}
}
}
return validip;
}
To copy to clipboard, switch view to plain text mode
Bookmarks