浏览代码

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

cxs 3 年之前
父节点
当前提交
b4063748b9
共有 1 个文件被更改,包括 10 次插入6 次删除
  1. 10 6
      OTSIncAMeasureApp/Program.cs

+ 10 - 6
OTSIncAMeasureApp/Program.cs

@@ -12,14 +12,18 @@ namespace OTSMeasureApp
         [STAThread]
         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;