Browse Source

打开软加密权限

zhangjiaxin 2 years ago
parent
commit
759b6b8dc8
2 changed files with 18 additions and 16 deletions
  1. 14 12
      OTSIncAMeasureApp/CRegistration.cs
  2. 4 4
      OTSIncAMeasureApp/Program.cs

+ 14 - 12
OTSIncAMeasureApp/CRegistration.cs

@@ -14,23 +14,25 @@ namespace OTSMeasureApp
    
         public bool RegistrationVerification()
         {
-           
-            try
-            {
-                //if (!checkRegistration())//文件授权法
-                //{
-                //    return false;
 
-                //}
-                //狗加密法
-                SenseShield.DogDecrypting.decrypting(101);//参数为许可号
-            }
-            catch (Exception ex)
+            if (!checkRegistration())//文件授权法
             {
+                //return false;
+                try
+                {
 
-                return false;
+                    //狗加密法
+                    SenseShield.DogDecrypting.decrypting(101);//参数为许可号
+                }
+                catch (Exception ex)
+                {
+
+                    return false;
 
+                }
             }
+
+            
             return true;
         }
         private bool checkRegistration()

+ 4 - 4
OTSIncAMeasureApp/Program.cs

@@ -22,11 +22,11 @@ namespace OTSMeasureApp
                     System.Environment.Exit(0);
                     return;
                 }
-            }
-            
-            //--------------------------只运行一个测量程序--------------------------------
+        }
+
+        //--------------------------只运行一个测量程序--------------------------------
 
-            bool flag = false;
+        bool flag = false;
             System.Threading.Mutex mutex = new System.Threading.Mutex(true, "OTSIncAMeasureApp", out flag);
             //第一个参数:true--给调用线程赋予互斥体的初始所属权  
             //第一个参数:互斥体的名称