Browse Source

只有非调试状态检查加密狗

cxs 3 years ago
parent
commit
b4063748b9
1 changed files with 10 additions and 6 deletions
  1. 10 6
      OTSIncAMeasureApp/Program.cs

+ 10 - 6
OTSIncAMeasureApp/Program.cs

@@ -12,14 +12,18 @@ namespace OTSMeasureApp
         [STAThread]
         [STAThread]
         static void Main()
         static void Main()
         {
         {
-            //判断是否有授权
-            var reg = new CRegistration();
-            if (!reg.RegistrationVerification())
+            if (!System.Diagnostics.Debugger.IsAttached)
             {
             {
-                MessageBox.Show("Error: missing authorization");
-                System.Environment.Exit(0);
-                return;
+                //判断是否有授权
+                var reg = new CRegistration();
+                if (!reg.RegistrationVerification())
+                {
+                    MessageBox.Show("Error: missing authorization");
+                    System.Environment.Exit(0);
+                    return;
+                }
             }
             }
+            
             //--------------------------只运行一个测量程序--------------------------------
             //--------------------------只运行一个测量程序--------------------------------
 
 
             bool flag = false;
             bool flag = false;