2 ghyghost ghyghost 于 2016.02.28 17:54 提问

为什么getCanonicalHostName值是activate.adobe.com呢

public static void main(String[] args) {
try {
Enumeration networkInterfaceEnum = NetworkInterface
.getNetworkInterfaces();
while (networkInterfaceEnum.hasMoreElements()) {
NetworkInterface eachNetworkInterfaceEnum = networkInterfaceEnum
.nextElement();
System.out.println("getName="
+ eachNetworkInterfaceEnum.getName());
System.out.println("getDisplayName="
+ eachNetworkInterfaceEnum.getDisplayName());
Enumeration inetAddressesNum = eachNetworkInterfaceEnum
.getInetAddresses();
while (inetAddressesNum.hasMoreElements()) {
InetAddress eachInetAddress = inetAddressesNum
.nextElement();

                System.out.println("  getCanonicalHostName="
                        + eachInetAddress.getCanonicalHostName());
                System.out.println("  getHostName="
                        + eachInetAddress.getHostName());
                System.out.println("  getHostAddress="
                        + eachInetAddress.getHostAddress());
                System.out.println("  getAddress=");
                byte[] addressByteArray = eachInetAddress.getAddress();
                if (addressByteArray != null
                        && addressByteArray.length != 0) {
                    for (int i = 0; i < addressByteArray.length; i++) {
                        System.out.print("  " + addressByteArray[i] + " ");
                    }
                }
            }

            System.out.println();
            System.out.println();
        }
    } catch (SocketException e) {
        e.printStackTrace();
    }

}

下面是打印结果:

getName=lo
getDisplayName=MS TCP Loopback interface
getCanonicalHostName=activate.adobe.com
getHostName=activate.adobe.com
getHostAddress=127.0.0.1
getAddress=
127 0 0 1

为什么loopback的getCanonicalHostName值是activate.adobe.com呢?为什么啊?求解

1个回答

caozhy
caozhy   Ds   Rxr 2016.02.28 18:40

估计是你电脑安装的盗版的photoshop,为了防止系统连上adobe的激活服务器验证,破解程序修改了hosts文件。

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!