Topic: 有谁知道怎么用Java控制Windows的进程吗?

  Print this page

1.有谁知道怎么用Java控制Windows的进程吗? Copy to clipboard
Posted by: moshen62
Posted on: 2004-08-07 11:42

最近我最程序时 碰到一个问题就是怎么用Java控制Windows的进程
请各位大虾们 指点一二 Big Smile

2.Re:有谁知道怎么用Java控制Windows的进程吗? [Re: moshen62] Copy to clipboard
Posted by: lifangning
Posted on: 2004-08-07 20:52

Java自身是操作系统无关的,所以如果想做任何操作系统相关的事情,就考虑使用JNI吧。

3.Re:有谁知道怎么用Java控制Windows的进程吗? [Re: moshen62] Copy to clipboard
Posted by: elysium922
Posted on: 2004-08-09 17:29

其实对进程作一些基本的操作还是可以的
Process process = Runtime.getRuntime().exec("Your command goes here"):
// you can do something with the OutputStream later
OutputStream out = process.getOutputStream();
process.waitFor(); // wait for the process to terminate


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923