How to get LAN ip Address
prankur.sarbhai last edited by
I am using the following code to get the ip address
foreach (const QHostAddress &address, QNetworkInterface::allAddresses())
if (address.protocol() == QAbstractSocket::IPv4Protocol && address != QHostAddress(QHostAddress::LocalHost))
qDebug() << address.toString();
IpAddr = address.toString();
I am connected with lan and Wlan both , so it displays 2 address. Can you please let me know how to distinguish between LAn and Wlan?
[[marked up code, Tobias]]
tobias.hunger last edited by
You can not do that based on the IP address.