管道基础大数据平台系统开发-【CS】-ExportMap
1
13693261870
2023-08-03 87b782c2132c645b667032598403896518055f9a
ExportMap/cs/Tools.cs
@@ -210,6 +210,9 @@
                p.StartInfo.RedirectStandardError = true;
                p.Start();
                task.pid = p.Id;
                task.id = TaskDBHelper.Insert(task);
                StreamWriter si = p.StandardInput; // 标准输入流 
                StreamReader so = isOut ? p.StandardOutput : null; // 标准输出流 
                StreamReader se = p.StandardError; // 标准错误流
@@ -229,6 +232,13 @@
                if (!string.IsNullOrEmpty(str)) LogOut.Error(str);
                if (p.HasExited == false) p.Kill();
                task = TaskDBHelper.SelectById(task.id);
                if (null != task && task.status < 2)
                {
                    task.status = 2;
                    TaskDBHelper.Update(task);
                }
                se.Close();
                //so.Close();
                si.Close();
@@ -238,6 +248,13 @@
            {
                LogOut.Error(ex.Message + "\r\n" + ex.StackTrace);
                str = ex.Message;
                task = TaskDBHelper.SelectById(task.id);
                if (null != task && task.status < 2)
                {
                    task.err = ex.Message;
                    task.status = 4;
                    TaskDBHelper.Update(task);
                }
            }
            return str;