//结果输出4(筛选内网网卡)
void Output4(PIP_ADAPTER_INFO pIpAdapterInfo)
{
//可能有多网卡,因此通过循环去判断
while (pIpAdapterInfo)
{
//筛选内网网卡
if (!IsIntranetIP(pIpAdapterInfo))
{
pIpAdapterInfo = pIpAdapterInfo->Next;
continue;
}
//输出信息
cout << "网卡名称:" << pIpAdapterInfo->AdapterName << endl;
cout << "网卡描述:" << pIpAdapterInfo->Description << endl;
cout << "网卡MAC地址:" << pIpAdapterInfo->Address;
for (UINT i = 0; i < pIpAdapterInfo->AddressLength; i++)
{
if (i == pIpAdapterInfo->AddressLength - 1)
{
printf("%02x\n", pIpAdapterInfo->Address[i]);
}
else
{
printf("%02x-", pIpAdapterInfo->Address[i]);
}
}
cout << "网卡IP地址如下:" << endl;
IP_ADDR_STRING *pIpAddrString = &(pIpAdapterInfo->IpAddressList);
//可能网卡有多IP,因此通过循环去判断
do
{
cout << pIpAddrString->IpAddress.String << endl;
pIpAddrString = pIpAddrString->Next;
} while (pIpAddrString);
pIpAdapterInfo = pIpAdapterInfo->Next;
cout << "*****************************************************" << endl;
}
return;
}
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx