一个傻比问题 Runtime.getRuntime().exec("sb.exe","sb.in"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public executeExe(){....Runtime.getRuntime().exec("sb.exe","sb.in");.....}public readFile(){ int b; byte buffer[]=new byte[2500]; try{ FileInputStream readfile=new FileInputStream("sb.out"); b=readfile.read(buffer,0,2500); try { String str=new String(buffer,0,b,"Default"); System.out.println(str); } catch(UnsupportedEncodingException e) { System.out.println(" the encoding was not found:"+e); } } catch(IOException e) {System.out.println("File read Error "); } }} Runtime.getRuntime().exec("sb.exe","sb.in");时候报错,如何解决安全问题? 你要捕捉異常,還有就是要注意應用程序的路徑問題,比如exec("c:\1.exe")什麼的~~~ 先谢谢aiur捕捉異常还有就是一个疑问!java能让你随便调用exe文件吗?那如果我调用电源管理的不死机了? EJB3.0实体 主键 自增 用java逐点操作图像问题 解析邮件地址 repaint()怎么不去调用paint()啊? 小鸟问题__编译时提示缺少分号~ applet装载的图片是不是不能在appletViewer下运行显示? 请问Stream关闭问题 hashtable 的问题请教 天高任鹏翔,进来领分 用JAVA APPLET如何做出股票显示屏的效果?有偿求助!!! 我要为读写一个数据表做一个进度条如何做 希望高手指点迷津......着急,着急
{
....
Runtime.getRuntime().exec("sb.exe","sb.in");
.....
}
public readFile()
{ int b;
byte buffer[]=new byte[2500];
try{ FileInputStream readfile=new FileInputStream("sb.out");
b=readfile.read(buffer,0,2500);
try { String str=new String(buffer,0,b,"Default");
System.out.println(str);
}
catch(UnsupportedEncodingException e)
{ System.out.println(" the encoding was not found:"+e);
}
}
catch(IOException e)
{System.out.println("File read Error ");
}
}
}