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://www.cnblogs.com/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 + " " + 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+" "+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

  • 相关阅读:
    vue 设置初始值 为null 进行文字长度判断
    js ajax传参 定义的参数和传的参数不一样
    js 删除字符串前几位字符,和删除最后一个字符
    js splice 删除数组 相邻的数据满足条件未被删掉
    js 将对象增加新键值对
    js 将数组添加key
    js 删除掉数组中的 ' '
    js 如何删除数组中指定对象及其值
    接口
    分支结构
  • 原文地址:https://www.cnblogs.com/attilax/p/5215253.html
Copyright © 2011-2022 走看看