Java獲取CPU序列號


獲取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

內容關於:工作中用到的小技術

本文部分來源於網絡,只做技術分享,一概不負任何責任


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM