JAVA如何读取硬盘序列号 如题啊~~JAVA如何读取硬盘序列号 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 有点难吧 好像java不能直接操作硬件。 要不有个构思在java中执行DOS查吧 可以参考在java中执行DOS命令 public static void main(String[] args) { String address = ""; String os = System.getProperty("os.name"); if (os != null && os.startsWith("Windows")) { try { String command = "cmd.exe /c ipconfig /all"; Process p = Runtime.getRuntime().exec(command); BufferedReader br = new BufferedReader(new InputStreamReader(p .getInputStream())); String line; while ((line = br.readLine()) != null) { if (line.indexOf("Physical Address") > 0) { int index = line.indexOf(":"); index += 2; address = line.substring(index); break; } } br.close(); System.out.println("mac address:" + address.trim()); } catch (IOException e) { System.out.println("Error:" + e.getMessage()); } } } 请教一下怎么把JSP网站和java应用程序结合 关于webService调用外部类遇到的问题,请大神们帮帮忙,谢谢! JSP连接SQL server的问题? 如何利用JSP将用Base64编码的字符串还原成图像? web高手进来看看~~ ResultSet 帮忙看下! jsp中是否有这个函数或方法 一个逆来顺受的问题 各位大虾救命啊!求救jsp中文问题! 生成的docx图片显示不出来 请问Heritrix怎么抓取需要用户名密码验证的网页? prefuse问题求教
public static void main(String[] args) {
String address = "";
String os = System.getProperty("os.name");
if (os != null && os.startsWith("Windows")) {
try {
String command = "cmd.exe /c ipconfig /all";
Process p = Runtime.getRuntime().exec(command);
BufferedReader br = new BufferedReader(new InputStreamReader(p
.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
if (line.indexOf("Physical Address") > 0) {
int index = line.indexOf(":");
index += 2;
address = line.substring(index);
break;
}
}
br.close();
System.out.println("mac address:" + address.trim());
} catch (IOException e) {
System.out.println("Error:" + e.getMessage());
}
}
}