Browse Source

禁用工具类使用认证测试

yuzhengyang 8 years ago
parent
commit
c733c2eb04

BIN
Fork.Net/.vs/Fork.Net/v15/sqlite3/storage.ide


+ 28 - 2
Fork.Net/Test/Y.Test/Views/Form1.Designer.cs

@@ -28,20 +28,46 @@
         /// </summary>
         private void InitializeComponent()
         {
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(136, 106);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(41, 12);
+            this.label1.TabIndex = 0;
+            this.label1.Text = "label1";
+            // 
+            // label2
+            // 
+            this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
+            this.label2.Location = new System.Drawing.Point(136, 137);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(113, 47);
+            this.label2.TabIndex = 1;
+            this.label2.Text = "label2";
+            // 
             // Form1
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(120, 279);
-            this.MinimumSize = new System.Drawing.Size(1, 1);
+            this.ClientSize = new System.Drawing.Size(529, 283);
+            this.Controls.Add(this.label2);
+            this.Controls.Add(this.label1);
+            this.MinimumSize = new System.Drawing.Size(16, 39);
             this.Name = "Form1";
             this.Text = "Form1";
             this.ResumeLayout(false);
+            this.PerformLayout();
 
         }
 
         #endregion
+
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label label2;
     }
 }

+ 1 - 1
Fork.Net/Y.Utils/DataUtils/Collections/ListTool.cs

@@ -26,7 +26,7 @@ namespace Y.Utils.DataUtils.Collections
         [Obsolete("Please Use HasElements(list)", false)]
         public static bool IsNullOrEmpty<T>(IEnumerable<T> list)
         {
-            YUtilsAuth.Start();
+            YUtilsAuth.Check();
             if (list != null && list.Count() > 0)
                 return false;
             return true;

+ 1 - 1
Fork.Net/Y.Utils/Properties/AssemblyInfo.cs

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
 //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
 // 方法是按如下所示使用“*”: :
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
+// [assembly: AssemblyVersion("1.0.0.0")]
 [assembly: AssemblyFileVersion("1.1.0.0")]

+ 16 - 15
Fork.Net/Y.Utils/YUtils/YUtilsAuth.cs

@@ -22,21 +22,20 @@ namespace Y.Utils.YUtils
         /// <summary>
         /// 工具类验证
         /// </summary>
-        public static void Start()
+        public static void Check()
         {
-            if (!IsStart)
-            {
-                IsStart = true;
-                if (IsStart)
-                {
-                    StartTime = DateTime.Now;
-                    Task.Factory.StartNew(() =>
-                    {
-                        CheckObsolete();
-                    });
-                }
-            }
-            if ((DateTime.Now - StartTime).TotalHours > 1) IsStart = false;
+            //if (!IsStart)
+            //{
+            //    IsStart = true;
+            //    if (IsStart)
+            //    {
+            //        StartTime = DateTime.Now;
+            //        Task.Factory.StartNew(() =>
+            //        {
+            //            CheckObsolete();
+            //        });
+            //    }
+            //}
         }
         /// <summary>
         /// 验证有效期
@@ -44,7 +43,9 @@ namespace Y.Utils.YUtils
         private static void CheckObsolete()
         {
             if (DateTime.Now > new DateTime(2018, 12, 2, 0, 0, 0))
-                MessageBox.Show("工具组件超出有效期,请更新工具组件。(https://github.com/yuzhengyang)", "超出有效期");
+                MessageBox.Show(
+                    "工具组件超出有效期,请更新工具组件。(https://github.com/yuzhengyang)",
+                    "Beyond the service period");
         }
     }
 }