|
@@ -50,16 +50,18 @@ namespace Client.Start
|
|
msg = ReadResultString(resultFilePath);
|
|
msg = ReadResultString(resultFilePath);
|
|
Console.WriteLine(DateTime.Now + " 命令执行完成:" + revitCmd);
|
|
Console.WriteLine(DateTime.Now + " 命令执行完成:" + revitCmd);
|
|
//执行完成后,删除文件
|
|
//执行完成后,删除文件
|
|
|
|
+#if !DEBUG
|
|
foreach (var f in filePathList)
|
|
foreach (var f in filePathList)
|
|
{
|
|
{
|
|
File.Delete(f);
|
|
File.Delete(f);
|
|
}
|
|
}
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
catch (Exception e)
|
|
catch (Exception e)
|
|
{
|
|
{
|
|
- Console.WriteLine(e.Message+"\r\n"+e.StackTrace);
|
|
|
|
|
|
+ Console.WriteLine(e.Message + "\r\n" + e.StackTrace);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
return msg;
|
|
return msg;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -91,7 +93,7 @@ namespace Client.Start
|
|
private string GetReusltFileName()
|
|
private string GetReusltFileName()
|
|
{
|
|
{
|
|
string localPath = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
|
string localPath = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
|
|
- string fileName = "Result_" + Guid.NewGuid().ToString()+".txt";
|
|
|
|
|
|
+ string fileName = "Result_" + Guid.NewGuid().ToString() + ".txt";
|
|
return Path.Combine(localPath, "RevitService", fileName);
|
|
return Path.Combine(localPath, "RevitService", fileName);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
@@ -102,8 +104,13 @@ namespace Client.Start
|
|
private string ReadResultString(string filePath)
|
|
private string ReadResultString(string filePath)
|
|
{
|
|
{
|
|
Console.WriteLine(filePath);
|
|
Console.WriteLine(filePath);
|
|
- string str = File.ReadAllText(filePath);
|
|
|
|
- File.Delete(filePath);
|
|
|
|
|
|
+ string str = "";
|
|
|
|
+ if (File.Exists(filePath))
|
|
|
|
+ {
|
|
|
|
+ str = File.ReadAllText(filePath);
|
|
|
|
+ File.Delete(filePath);
|
|
|
|
+ }
|
|
|
|
+
|
|
return str;
|
|
return str;
|
|
}
|
|
}
|
|
}
|
|
}
|