→ MonyemLi: 偵測作業系統後外部呼叫,lib應該也是這樣做的 10/07 13:22
→ junk: 感謝你的回答,但能不能說明具體一點?對我來說偵測作業系統 10/07 17:23
→ junk: 使用System.getProperty("os.name") 10/07 17:23
→ MonyemLi: 1.判斷os,因為os的command line叫法不同,ex:cmd.shell 10/08 08:42
→ MonyemLi: 2.執行各OS找cpu的cmd,ex:vbs,systeminfo,cpuinfo 10/08 08:46
→ MonyemLi: 3.用java執行外部command,取得輸出 10/08 08:48
→ MonyemLi: 4.解析輸出的資串,取得要的資料 10/08 08:49
→ junk: 感謝M大,已實做出來^^ 10/08 17:21
→ junk: Process process = Runtime.getRuntime().exec("cmd /k wmic 10/08 17:22
→ junk: cpu get name"); 10/08 17:23