1
我正在開發一個顯示過程及其操作的系統監視工具。我能夠通過執行tasklist.exe來檢索進程列表進程ID等。這是我的嘗試。識別過程的操作
try {
String line;
Process p = Runtime.getRuntime().exec(System.getenv("windir") + "\\system32\\" + "tasklist.exe");
BufferedReader input
= new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = input.readLine()) != null) {
System.out.println(line); //<-- Parse data here.
}
input.close();
} catch (Exception err) {
err.printStackTrace();
}
我的要求是找到這個過程的操作。 請參考示例截圖。
我試過java api doc。在API中提到了6種方法。但他們都沒有提供關於流程中的子流程或操作的信息。
就像在附加的圖像,我想檢索任務的操作列表。 任何幫助是高度讚賞。
謝謝。
你最好打賭 - JNI或JNA,然後鑽研並學習合適的API。 –