用java.lang.Runtime 类调用exec方法执行doc 语句
解决方案 »
- 在MyEclipse DBBrowse里连接oracle 无法编辑表 提示cannot edit
- 高手来,小弟急求解答!
- Java操作Excel单元格
- 一个struts的异常
- 上海复旦光华信息科技股份有限公司 怎么样?
- 请问使用hibernate开发客户端程序(Oracle),究竟需要那几个开发包?
- 再问 midp2.0 上做socket通信 手机要做怎么的设置?
- *************在北京 有志立业 有管理组织领导才能的JAVA人员请进*********
- 什么是 Inprise Application Server
- 在jsp里面怎样取得客户端的IP?
- 在Tomcat下部署Struts程序启动时出现异常?
- 如何学习SEVLET和JSP技术 谢谢
Runtime runtime = Runtime.getRuntime();
Process process = null;
String as = '"' + key + '"';
String execCommand = "ping IP " ;
process = runtime.exec(execCommand);
//process.waitFor();
is = process.getInputStream();
isr = new InputStreamReader(is);
br = new BufferedReader(isr);
for (int i = 0; i < 4; i++) {
if (br.readLine() != null) {
line = br.readLine();
}
if (i == 1) {
status = Integer.parseInt(line.substring(29, 30));
// System.out.println("-status----"+status);
}
}
不知道怎么做?/