ToolKit.getRuntime().exec("需要执行的DOS命令");

解决方案 »

  1.   

    ToolKit.getRuntime().exec("需要执行的DOS命令");
      

  2.   

    InputStream isPing = null;
        InputStreamReader isrPing = null;
        StringBuffer sb = new StringBuffer();
        Process psPing = null;
        Process psTracert = null;    try {
          psPing = rt.exec("tracert " + ip);
          isPing = psPing.getInputStream();
          isrPing = new InputStreamReader(isPing);
          int t;
          while ( (t = isPing.read()) != -1) {
            if (t == 10)
              sb.append("<br>");
            sb.append( (char) t);
          }
          isPing.close();
          isrPing.close();
          //logger.debug(sb.toString());
        }
        catch (IOException ex) {
          logger.error("IOException :" + ex.toString());
          errors.add("supervise", new ActionError("error.supervise.pingfail"));
          saveErrors(httpServletRequest, errors);
          return actionMapping.findForward("fail");
        }
      

  3.   

    有没有在说得详细一点的呢? 
      比如说我要调用远程计算机的DOS命令来对远程计算机进行操作呢?
         谢谢!