|
@@ -7,6 +7,7 @@
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Diagnostics;
|
|
|
+using System.IO;
|
|
|
using System.Linq;
|
|
|
using System.Windows.Forms;
|
|
|
|
|
@@ -22,21 +23,21 @@ namespace Client.Start
|
|
|
//由revitCmd生成实体类
|
|
|
//实体类传入参数、参考楼层列表
|
|
|
//执行方法,返回执行结果
|
|
|
- Console.WriteLine("准备执行命令");
|
|
|
- Process process=new Process();//AppDomain.CurrentDomain.BaseDirectory +
|
|
|
- process.StartInfo.FileName = "ExportStart.exe";//执行的exe路径
|
|
|
+ Console.WriteLine(DateTime.Now+" 准备执行命令:"+revitCmd);
|
|
|
+ string fullPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ExportStart.exe");
|
|
|
+ Process process = new Process();//AppDomain.CurrentDomain.BaseDirectory +
|
|
|
+ process.StartInfo.FileName = fullPath;//执行的exe路径
|
|
|
process.StartInfo.UseShellExecute = false;//不显示shell
|
|
|
process.StartInfo.CreateNoWindow = true;//不创建窗口
|
|
|
process.StartInfo.RedirectStandardInput = true;//打开流输入
|
|
|
process.StartInfo.RedirectStandardOutput = true;//打开流输出
|
|
|
process.StartInfo.RedirectStandardError = true;//打开错误流
|
|
|
- process.StartInfo.Arguments = "(" + revitCmd + " \"" + filePathList.First() + "\")";//输入参数,多个参数使用空间分割,如果一个参数包含空格,使用""包括此参数
|
|
|
+ process.StartInfo.Arguments = "" + revitCmd + " \"" + filePathList.First() + "\"";//输入参数,多个参数使用空间分割,如果一个参数包含空格,使用""包括此参数
|
|
|
process.Start();//执行
|
|
|
string msg = process.StandardOutput.ReadToEnd();//读取输出
|
|
|
process.WaitForExit();//等待执行完成
|
|
|
process.Close();//结束
|
|
|
-
|
|
|
- MessageBox.Show("命令执行完成 ");
|
|
|
+ Console.WriteLine(DateTime.Now + " 命令执行完成:" + revitCmd);
|
|
|
|
|
|
return msg;
|
|
|
}
|