浏览代码

修复客户端只启动一次的验证

yuzhengyang 8 年之前
父节点
当前提交
4046bbfd29
共有 2 个文件被更改,包括 10 次插入5 次删除
  1. 二进制
      Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide
  2. 10 5
      Fork.Net/Fork.Net.Tools/Y.Utils/AppUtils/AppUnique.cs

二进制
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide


+ 10 - 5
Fork.Net/Fork.Net.Tools/Y.Utils/AppUtils/AppUnique.cs

@@ -1,22 +1,27 @@
-//############################################################
+//************************************************************************
 //      https://github.com/yuzhengyang
-//      author:yuzhengyang
-//############################################################
+//      author:     yuzhengyang
+//      date:       2017.10.12 - 2017.10.12
+//      desc:       App唯一启动工具
+//      Copyright (c) yuzhengyang. All rights reserved.
+//************************************************************************
 using System.Threading;
 
 namespace Y.Utils.AppUtils
 {
     public sealed class AppUnique
     {
+        private Mutex Mutex { get; set; }
+
         /// <summary>
         /// 判断应用在当前系统实例下是否唯一
         /// </summary>
         /// <param name="appName"></param>
         /// <returns></returns>
-        public static bool IsUnique(string appName)
+        public bool IsUnique(string appName)
         {
             bool unique;
-            Mutex run = new Mutex(true, appName, out unique);
+            Mutex = new Mutex(true, appName, out unique);
             return unique;
         }
     }