zoukankan      html  css  js  c++  java
  • atitit.基于bat cli的插件管理系统.doc

    atitit.基于bat cli的插件管理系统.doc

     

     

    /AtiPlatf/src_atibrow/com/attilax/cmd/CmdX.java

     

    pathx.isWebPathMode=true;

    String bat=pathx.classPathParent()+"/other/del_indexs.bat";

    bat=bat.replace("/""\\");

    String cmd=" cmd.exe /c \""+bat+"\"";

    System.out.println(cmd);

    String r=exe(cmd);

    System.out.println("----echo:"+r);

    System.out.println("--f");

     

    作者:: 绰号:老哇的爪子 ( 全名::Attilax Akbar Al Rapanui 阿提拉克斯 阿克巴 阿尔 拉帕努伊 ) 汉字名:艾龙,  EMAIL:1466519819@qq.com

    转载请注明来源: http://blog.csdn.net/attilax

     

     

    public static String exe(String cmd) {

    try {

    String r = "";

    // 执行 CMD 命令

    Process process = Runtime.getRuntime().exec(cmd);

    //System.out.println("--echo stdin info:");

    r = echoCmdResult_asStr(process.getInputStream());

    //System.out.println("--echo err info:");

    r = r + "\r\n" + echoCmdResult_asStr(process.getErrorStream());

     

    //System.out.println("cmd ext finish!");

    return r;

    catch (Exception e) {

    throw new RuntimeException(e);

    }

     

    }

     

     

     

    private static String echoCmdResult_asStr(InputStream cmdStream)

     

    {

    String r="";

     

     

    BufferedReader reader = null;

    // BufferedReader reader;

    InputStreamReader inputStreamReader;

    try {

    inputStreamReader = new InputStreamReader(cmdStream,

    "gbk");

    catch (UnsupportedEncodingException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    throw new RuntimeException(e);

    }

    reader = new BufferedReader(inputStreamReader);

    String line = null;

    try {

    line = reader.readLine();

    catch (IOException e1) {

    // TODO Auto-generated catch block

    e1.printStackTrace();

    }

     

    while (line != null) {

    //System.out.println(line);

    r=r+"\r\n"+line;

    try {

    line = reader.readLine();

    catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    }

    if (reader != null) {

    try {

    reader.close();

    catch (IOException e) {

    // TODO Auto-generated catch block

    e.printStackTrace();

    }

    }

     return r;

    }

    Cank

    atitit.插件体系设计总结o73.doc - attilax的专栏 博客频道 - CSDN.NET.htm

    Atitit 插件机制原理与设计微内核 c# java 的实现attilax总结 - attilax的专栏 博客频道 - CSDN.NET.htm

  • 相关阅读:
    Makefile:(实验)多个目标匹配时会采用最完整匹配的目标
    线程调度为什么比进程调度更少开销?
    关于makefile中自动产生依赖的理解
    makefile中重载与取消隐藏规则示例
    xargs命令的使用过程中一个小领悟:管道与xargs的差别
    CODING 远程办公 开工不断线
    【 ECUG 演讲分享】吴海黎:CODING 微服务架构演进之路
    张海龙:云时代企业研发人员需求与人才培养
    腾讯云大学 x CODING | DevOps 实战:Jenkins Docker
    腾讯云大学 x CODING | 敏捷开发与 DevOps 实战
  • 原文地址:https://www.cnblogs.com/attilax/p/15198707.html
Copyright © 2011-2022 走看看