Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

How to get LAN ip Address

$
0
0
Hi, 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? Regards, Prankur [marked up code, Tobias]

Viewing all articles
Browse latest Browse all 18427

Trending Articles