about java调用系统命令问题 process提供的public abstract int exitValue()Returns the exit value for the subprocess. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 下面是调用系统命令的例子,不管执行是否失败,都会返回InputStream的,你根据返回内容判断。 Process p = null; Properties envVars = new Properties(); Runtime r = Runtime.getRuntime(); try { p = r.exec( "cmd.exe /c chkdsk" ); BufferedReader br = new BufferedReader ( new InputStreamReader( p.getInputStream() ) ); String line; while( (line = br.readLine()) != null ) { System.out.println(line); } } catch(Exception e) { e.printStackTrace(); } 求一个jsp系统 cxf2.0.10发布的问题.weblogic(100分) java调存储过程问题 关天struts源码的一个简单问题? Jacorb Notification Service 初学者:关于STRUTS问题!请大家帮一下忙 求救:操作数据库时遇到的问题 [在线] Java in a Nutshell,2nd Edition 的电子版何处可以download?(英文的也可以) 出现事务已提交没有活动的事务,导致无法调用数据库如何解决?? 关于XML字符串转化的问题 关于在Servlet中调用EJB的问题 求jbx在linux底下的注册文件
Properties envVars = new Properties();
Runtime r = Runtime.getRuntime();
try
{
p = r.exec( "cmd.exe /c chkdsk" );
BufferedReader br = new BufferedReader ( new InputStreamReader( p.getInputStream() ) );
String line;
while( (line = br.readLine()) != null ) {
System.out.println(line);
}
}
catch(Exception e)
{
e.printStackTrace();
}