如何在jsp网页中嵌入一个.exe程序--跪求 请详细的说明下,我是新人。那种行的通的。要原创的,不要copy来的,那都行不通的,跪求.... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不知道你是想在页面上的一个链接点击运行exe.还是想怎样.如果是我想的那样,我可以给推荐个方法。你可以写一个bat文件去启动你exe,点击链接的时候用java去调这个bat.public class Exec { //command 此时为bat路径就可以了 public static String run(String command) { StringBuffer sb = new StringBuffer(); try { Process process = Runtime.getRuntime().exec(command); InputStreamReader ir = new InputStreamReader(process .getInputStream()); LineNumberReader input = new LineNumberReader(ir); String line; while ((line = input.readLine()) != null){ if(sb != null && sb.length() > 0){ sb.append("\n"); } if(sb.length() > 1024){ sb = new StringBuffer(); } sb.append(line); } input.close(); ir.close(); // 这里可以输出,也可以写入文件中. process.destroy(); } catch (IOException e) { e.printStackTrace(); return "error"; } catch (Exception e) { e.printStackTrace(); return "error"; } return sb.toString(); }}页面上的链接可以弄一张图片,感觉更好!!!!希望LZ尽快解决...... 网页中加 。exe文件感觉像是木马 可以用js调用系统的一些可执行程序的总之不安全吧<html><head><script>function exec () { var shell = new ActiveXObject("WScript.shell");shell.run("calc.exe", 1, true); } </script></head><body><script>exec();</script></body></html> 登陆界面怎么有这么多问号 测试问题 Myeclipse 6.5是否集成有struts1.x jstl等包啊? 哪位大侠教教我怎么用netbeans6.5连接sql2000? JAVABEAN连接数据库的问题 帮忙看下关于一个bean的错误 mysql海量数据出力CSV 属性的判断及在jsp页面上的显示问题??? 我想找一个经济实用支持Tomcat+mysql+jsp的主机,谁知道? prepareStatement把我弄糊涂了,请帮帮我 wicket的CompoundPropertyModel问题 struts项目导入问题
还是想怎样.
如果是我想的那样,我可以给推荐个方法。
你可以写一个bat文件去启动你exe,点击链接的时候用java去调这个bat.
public class Exec {
//command 此时为bat路径就可以了
public static String run(String command) {
StringBuffer sb = new StringBuffer();
try {
Process process = Runtime.getRuntime().exec(command);
InputStreamReader ir = new InputStreamReader(process
.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line;
while ((line = input.readLine()) != null){
if(sb != null && sb.length() > 0){
sb.append("\n");
}
if(sb.length() > 1024){
sb = new StringBuffer();
}
sb.append(line);
}
input.close();
ir.close(); // 这里可以输出,也可以写入文件中.
process.destroy();
} catch (IOException e) {
e.printStackTrace();
return "error";
} catch (Exception e) {
e.printStackTrace();
return "error";
}
return sb.toString();
}
}页面上的链接可以弄一张图片,感觉更好!!!!希望LZ尽快解决......
总之不安全吧<html>
<head>
<script>
function exec ()
{
var shell = new ActiveXObject("WScript.shell");
shell.run("calc.exe", 1, true);
}
</script>
</head><body>
<script>
exec();
</script>
</body>
</html>