Native.js 运行 exec 命令
howryanl
- 发布:2022-06-23 14:01
- 更新:2022-06-23 14:03
- 阅读:296
Native.js 运行 exec 命令
分类:Native.js
1 个回复
howryanl (作者)
这种在uniapp 里面如何调用?
public void executeCMD() {
try {
Runtime mt = Runtime.getRuntime();
String cmd = "ping 127.0.0.1";
Process pro = mt.exec(cmd);
InputStream ers= pro.getErrorStream();
pro.waitFor();
} catch (IOException ioe) {
ioe.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}