文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>获取网卡MAC地址

获取网卡MAC地址

时间:2010-06-10  来源:lzn_sc

获取网卡MAC地址


    /**
    * 获取网卡MAC地址
    */
    public static String getMacOnWindow() {
        try {
            String mac = null;
            Process process = Runtime.getRuntime().exec("ipconfig /all");
            BufferedReader buffer =
            new BufferedReader(new InputStreamReader(process.getInputStream()));
            for (String line = buffer.readLine(); line != null; line = buffer.readLine()) {
            int index = line.indexOf("Physical Address");
                if (index <= 0) {
                    continue;
                }
                mac = line.substring(index + 36);
                break;
            }
            buffer.close();
            process.waitFor();
            return mac;
        } catch (Exception exception) {
        return null;
        }
    }
相关阅读 更多 +
排行榜 更多 +
子午线157第2章

子午线157第2章

冒险解谜 下载
冲破牢笼手机版

冲破牢笼手机版

飞行射击 下载
冲突2西线安卓版

冲突2西线安卓版

飞行射击 下载