J2SE实现windows下读取网卡的物理地址
百度广告
package com.kuaff.jdk5package;
import java.io.IOException;
import java.util.ArrayList;
public class ProcessBuilderShow
public static List getPhysicalAddress()
Process p = null;
List address = new ArrayList();
try
//执行ipconfig /all命令
}
{
}
StringBuffer sb = new StringBuffer();
InputStream in = p.getInputStream();
{
0)
sb.append(new String(b));
}
{
finally
try
in.close();
catch (IOException e2)
}
//以下分析输出值,得到物理网卡
int i = rtValue.indexOf("Physical Address. . . . . . . . . :");
0)
rtValue = rtValue.substring(i + "Physical Address. . . . . . . . . :".length());
i = rtValue.indexOf("Physical Address. . . . . . . . . :");
public static void main(String args)
List address = ProcessBuilderShow.getPhysicalAddress();
{
}
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>