Browse Source

[fix]

HuiZhou
fajiao 2 years ago
parent
commit
346d7ca0dd
  1. 5
      AutoWeightServer/Program.cs
  2. 1
      EC.Utils/CommonUtil.cs

5
AutoWeightServer/Program.cs

@ -2,6 +2,8 @@
using EC.Utils.Storage;
using System;
using System.Data.SqlClient;
using System.IO;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Windows.Forms;
@ -18,6 +20,7 @@ namespace EC.AutoWeightServer
[STAThread]
private static void Main()
{
Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
@ -46,7 +49,6 @@ namespace EC.AutoWeightServer
{
string str = GetExceptionMsg(e.Exception, e.ToString());
LogUnit.Error("全局异常捕获 CSUI:\r\n" + str);
// logService.WriteDbLog(4, "9", "卷丝-全局异常捕获", "CSUI", false, str);
MessageBox.Show("操作执行异常,可尝试重新执行!\r\n\r\n" + e.Exception.Message, "UIException " + e.Exception.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(1);
@ -56,7 +58,6 @@ namespace EC.AutoWeightServer
{
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
LogUnit.Error("全局异常捕获 CSUnUI:\r\n" + str);
// logService.WriteDbLog(4, "9", "卷丝-全局异常捕获", "CSUnUI", false, str);
MessageBox.Show("操作执行异常,程序即将关闭!\r\n\r\n" + (e.ExceptionObject as Exception)?.Message, "UnUIException " + (e.ExceptionObject as Exception)?.GetType().Name, MessageBoxButtons.OK, MessageBoxIcon.Error);
Environment.Exit(1);

1
EC.Utils/CommonUtil.cs

@ -225,6 +225,5 @@ namespace EC.Utils
workDirectory = string.IsNullOrEmpty(workDirectory) ? Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) : workDirectory;
return workDirectory;
}
}
}
Loading…
Cancel
Save