老熟女激烈的高潮_日韩一级黄色录像_亚洲1区2区3区视频_精品少妇一区二区三区在线播放_国产欧美日产久久_午夜福利精品导航凹凸

重慶分公司,新征程啟航

為企業(yè)提供網(wǎng)站建設(shè)、域名注冊(cè)、服務(wù)器等服務(wù)

java輸出服務(wù)器的mac地址-創(chuàng)新互聯(lián)

import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;

public class PrintServerMacInfo {

    private static ListgetMacAddress4Linux() throws Exception {
        ListmacAddressList = new ArrayList<>();
        ListinetAddresses = getLocalAllInetAddress();
        if (inetAddresses != null && inetAddresses.size() >0) {
            for( InetAddress inetAddress:inetAddresses ) {
                String macAddress = getMacByInetAddress(inetAddress);
                macAddressList.add( macAddress );
            }
        }
        return macAddressList;
    }

    private static ListgetMacAddress4Windows() throws Exception {
        ListmacAddressList = new ArrayList<>();
        ListinetAddresses = getLocalAllInetAddress();
        if (inetAddresses != null && inetAddresses.size() >0) {
            for( InetAddress inetAddress:inetAddresses ){
                String macAddress = getMacByInetAddress(inetAddress);
                macAddressList.add( macAddress );
            }
        }
        return macAddressList;
    }

    
    private static ListgetLocalAllInetAddress() throws Exception {
        Listresult = new ArrayList<>(4);
        for (Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); networkInterfaces.hasMoreElements(); ) {
            NetworkInterface iface = (NetworkInterface) networkInterfaces.nextElement();
            for (Enumeration inetAddresses = iface.getInetAddresses(); inetAddresses.hasMoreElements(); ) {
                InetAddress inetAddr = (InetAddress) inetAddresses.nextElement();
                if (!inetAddr.isLoopbackAddress()
                        && !inetAddr.isLinkLocalAddress() && !inetAddr.isMulticastAddress()) {
                    result.add(inetAddr);
                }
            }
        }
        return result;
    }

   
    private static String getMacByInetAddress(InetAddress inetAddr) {
        try {
            byte[] mac = NetworkInterface.getByInetAddress(inetAddr).getHardwareAddress();
            StringBuffer stringBuffer = new StringBuffer();

            for (int i = 0; i< mac.length; i++) {
                if (i != 0) {
                    stringBuffer.append("-");
                }

               
                String temp = Integer.toHexString(mac[i] & 0xff);
                if (temp.length() == 1) {
                    stringBuffer.append("0" + temp);
                } else {
                    stringBuffer.append(temp);
                }
            }
            return stringBuffer.toString().toUpperCase();
        } catch (SocketException e) {
            e.printStackTrace();
        }
        return null;
    }

    private static void printServerInfo() throws Exception {
        System.out.println( "server info:" );
        System.out.println( "macAddress list:" );
        String osName = System.getProperty("os.name").toLowerCase();
        
        ListmacAddressList = null;
        if (osName.startsWith("windows")) {
            macAddressList = getMacAddress4Windows();
        } else if (osName.startsWith("linux")) {
            macAddressList = getMacAddress4Linux();
        }else{
            macAddressList = getMacAddress4Linux();
        }
        if( macAddressList == null || macAddressList.size() == 0 ){
            return;
        }
        for( String macAddress:macAddressList ){
            System.out.println( "   " + macAddress );
        }
    }

    public static void main(String[] args) throws Exception {
        printServerInfo();
    }
}
javac PrintServerMacInfo.java
java PrintServerMacInfo

你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購(gòu),新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧

讓客戶(hù)滿(mǎn)意是我們工作的目標(biāo),不斷超越客戶(hù)的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶(hù),將通過(guò)不懈努力成為客戶(hù)在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:主機(jī)域名、虛擬空間、營(yíng)銷(xiāo)軟件、網(wǎng)站建設(shè)、郎溪網(wǎng)站維護(hù)、網(wǎng)站推廣。
當(dāng)前題目:java輸出服務(wù)器的mac地址-創(chuàng)新互聯(lián)
分享URL:http://www.xueling.net.cn/article/csicpj.html

其他資訊

在線(xiàn)咨詢(xún)
服務(wù)熱線(xiàn)
服務(wù)熱線(xiàn):028-86922220
TOP
主站蜘蛛池模板: 午夜爽爽爽男女免费观看影院 | 国产精品人妻无码一区二区三区 | 色窝窝亚洲AV网在线观看 | 成人在线中文字幕 | 无遮挡国产高潮视频免费观看 | 亚洲精品无人一区二区 | XXX波多野结衣苍井空 | 亚洲欧美日韩国产综合 | 91色精品视频在线 | 毛片在线一区二区观看精品 | 青青草视频在线观 | 国产精品爆乳奶水无码视频 | h人成在线看免费视频 | 大JI巴好深好爽又大又粗视频 | 精精国产视频 | 久久久久免费看黄a毛片肥婆 | 免费观看啪啪黄的网站 | 2021国产精品一卡2卡三卡4卡 | 97国产精品自拍 | 亚洲精品一品区二品区三品区 | 久久精品aaaaaa羞羞羞 | 女女久久| 欧美阿v高清资源不卡在线播放 | 丝袜无码一区二区三区 | 视频在线观看一区二区 | 精品国产麻豆一区二区三区 | 欧美三区二区一区 | 日韩成人在线免费观看 | 天天操天天干天天爱 | 成人性生交大片免费看vr | 国产99久久久精品 | 欧美9999| 99久久精品免费看蜜桃的推荐词 | 伊伊人成亚洲综合人网7777 | 亚洲精品wwwww | 四虎影院网站 | 少妇粉嫩小泬喷水视频WWW | 国内精品小视频 | 天天激情综合 | 激情中国色综合 | 搡女人真爽免费视频网站波兰美女 |