管道基础大数据平台系统开发-【CS】-ExportMap
13693261870
2023-06-14 d9e0be85179a39abe36a4cc23afd91798bcccb82
ExportMap/cs/Tools.cs
@@ -159,7 +159,7 @@
        /// </summary>
        /// <param name="cmd">命令行</param>
        /// <returns>执行结果或出错信息</returns>
        public static String ExecCmd(string cmd, bool isPy = false)
        public static String ExecCmd(string cmd, bool isPy = false, bool isOut = false)
        {
            List<string> list = new List<string>();
            if (isPy)
@@ -171,7 +171,7 @@
            }
            list.Add(cmd);
            string str = ExecCmd(list);
            string str = ExecCmd(list, isOut);
            return str;
        }
@@ -181,7 +181,7 @@
        /// </summary>
        /// <param name="list">命令集合</param>
        /// <returns>执行结果或出错信息</returns>
        public static string ExecCmd(List<string> list)
        public static string ExecCmd(List<string> list, bool isOut = false)
        {
            string str = null;
            try
@@ -197,7 +197,7 @@
                p.Start();
                StreamWriter si = p.StandardInput; // 标准输入流 
                //StreamReader so = p.StandardOutput; // 标准输出流
                StreamReader so = isOut ? p.StandardOutput : null; // 标准输出流
                StreamReader se = p.StandardError; // 标准错误流
                LogOut.Info("cmd = " + string.Join(",", list));
@@ -208,7 +208,7 @@
                }
                si.WriteLine("exit");
                //string info = so.ReadToEnd();
                string info = null == so ? null : so.ReadToEnd();
                str = se.ReadToEnd();
                //if (!string.IsNullOrEmpty(info)) LogOut.Debug(info);