Ver código fonte

捕捉未安装codesoft异常

shim 8 anos atrás
pai
commit
0b8d15ff45

+ 8 - 1
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -44,7 +44,14 @@ namespace UAS_MES.Make
             sncode.Focus();
             asc.controllInitializeSize(this);
             OperateResult.AppendText(">>请输入SN\n", Color.Green);
-            InitPrint = new Thread(InPrint);
+            try
+            {
+                InitPrint = new Thread(InPrint);
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();

+ 8 - 1
UAS-MES/FunctionCode/Make/Make_PalletWeigh.cs

@@ -59,7 +59,14 @@ namespace UAS_MES.Make
             ComList.Text = Properties.Settings.Default.PortName;
             BaudRate.Text = Properties.Settings.Default.BaudRate;
             dh = new DataHelper();
-            InitPrint = new Thread(InPrint);
+            try
+            {
+                InitPrint = new Thread(InPrint);
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.Message);
+            }
             SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
             BaseUtil.SetFormCenter(stw);
             stw.ShowDialog();