章政 7 жил өмнө
parent
commit
cc56b8efc2

+ 9 - 6
UAS_CheckWork/Form1.cs

@@ -11,10 +11,7 @@ namespace UAS_CheckWork
 {
     public partial class Form1 : Form
     {
-        public Form1()
-        {
-            InitializeComponent();
-        }
+     
         DataHelper dh;
         //Create Standalone SDK class dynamicly.
         public zkemkeeper.CZKEMClass axCZKEM1 = new zkemkeeper.CZKEMClass();
@@ -22,6 +19,13 @@ namespace UAS_CheckWork
         private int iMachineNumber = 1;//the serial number of the device.After connecting the device ,this value will be changed.
         //开启线程
         Thread InitGetInfo;
+
+        public Form1()
+        {
+            InitializeComponent();
+            StartPosition = FormStartPosition.CenterScreen;
+        }
+
         private void btnConnect_Click(object sender, EventArgs e)
         {
             if (txtIP.Text.Trim() == "" || txtPort.Text.Trim() == "")
@@ -127,7 +131,6 @@ namespace UAS_CheckWork
         private void Form1_Load(object sender, EventArgs e)
         {
             CheckForIllegalCrossThreadCalls = false;//可跨线程
-            StartPosition = FormStartPosition.CenterScreen;
             dh = new DataHelper();
         }
 
@@ -152,4 +155,4 @@ namespace UAS_CheckWork
             dh.BatchInsert(sql.ToString(), new string[] { "cl_emcode", "cl_time" }, cl_emcode.ToArray(), cl_time.ToArray());
         }
     }
-}
+}