日期:2014-05-18 浏览次数:20712 次
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>测试</title>
</head>
<body>
<form action="/test/testServlet" method="post">
请在下面的文本区域,写一段代码,计算1*2*3*4*5的结果<br/>
<textarea rows="8" id="context" ></textarea><br/>
<input type="submit" value="提交代码">
</form>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>测试</title>
</head>
<body>
<form action="/test/testServlet" method="post">
请在下面的文本区域,写一段代码,计算1*2*3*4*5的结果<br/>
<textarea rows="8" id="context" >
<%
int i = 1*2*3*4;
System.out.println(i);
%>
</textarea><br/>
<input type="submit" value="提交代码">
</form>
</body>
</html>
InputStream ins = null;;
String[] cmd = new String[] { "cmd.exe", "/C", "ipconfig" };
try {
Process process = Runtime.getRuntime().exec(cmd);
ins = process.getInputStream(); //cmd 的信息