PrintStream out = new PrintStream( new BufferedOutputStream( new FileOutputStream("test.out"))); System.setOut(out); System.setErr(out); Runtime.getRuntime().exec("hi.exe");输出保存到文件test.out外
java.lang.Process abstract InputStream getErrorStream() Gets the error stream of the subprocess. abstract InputStream getInputStream() Gets the input stream of the subprocess. 可以看看这个类,但是我没有搞定:( 希望你搞定了告诉我一声:)
我try下 arefe(arefe) 你的方法我也没搞定
ilka()的做个临时输出文件也是个好办法,呵呵....
try{ Process process = Runtime.getRuntime().exec("hi.exe"); String output;
BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(process.getInputStream())); while ( (output=bufferedReader.readLine()) != null) { .... } } catch(Exception e){....}
new PrintStream(
new BufferedOutputStream(
new FileOutputStream("test.out")));
System.setOut(out);
System.setErr(out);
Runtime.getRuntime().exec("hi.exe");输出保存到文件test.out外
abstract InputStream getErrorStream()
Gets the error stream of the subprocess.
abstract InputStream getInputStream()
Gets the input stream of the subprocess.
可以看看这个类,但是我没有搞定:(
希望你搞定了告诉我一声:)
arefe(arefe) 你的方法我也没搞定
Process process = Runtime.getRuntime().exec("hi.exe");
String output;
BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(process.getInputStream()));
while ( (output=bufferedReader.readLine()) != null)
{
....
}
}
catch(Exception e){....}
在98下怎么通过java调用内部命令
比如dir