獲取CPU序列號
1 /** 2 * 獲取CPU序列號 3 * @return 4 */ 5 public static String getCpuId() throws IOException { 6 Process process = Runtime.getRuntime().exec( 7 new String[]{"wmic", "cpu", "get", "ProcessorId"}); 8 process.getOutputStream().close(); 9 Scanner sc = new Scanner(process.getInputStream()); 10 String property = sc.next(); 11 String serial = sc.next(); 12 System.out.println(property + ": " + serial); 13 return serial; 14 }
作者:彼岸舞
時間:2020\06\24
內容關於:工作中用到的小技術
本文部分來源於網絡,只做技術分享,一概不負任何責任