懒得勤快 %!s(int64=6) %!d(string=hai) anos
pai
achega
9c6bb53e94

+ 1 - 5
Masuit.Tools.Core/Win32/WindowsCommand.cs

@@ -1,7 +1,6 @@
 using System;
 using System.ComponentModel;
 using System.Diagnostics;
-using System.Security.Cryptography;
 
 namespace Masuit.Tools.Win32
 {
@@ -10,7 +9,6 @@ namespace Masuit.Tools.Win32
     /// </summary>
     public static class WindowsCommand
     {
-
         /// <summary>
         /// 生成真正的随机数
         /// </summary>
@@ -19,9 +17,7 @@ namespace Masuit.Tools.Win32
         /// <returns></returns>
         public static int StrictNext(this Random r, int seed = Int32.MaxValue)
         {
-            byte[] b = new byte[4];
-            new RNGCryptoServiceProvider().GetBytes(b);
-            return new Random(BitConverter.ToInt32(b, 0)).Next(seed);
+            return new Random((int)Stopwatch.GetTimestamp()).Next(seed);
         }
 
         /// <summary>

+ 1 - 4
Masuit.Tools/Win32/WindowsCommand.cs

@@ -1,7 +1,6 @@
 using System;
 using System.ComponentModel;
 using System.Diagnostics;
-using System.Security.Cryptography;
 
 namespace Masuit.Tools.Win32
 {
@@ -18,9 +17,7 @@ namespace Masuit.Tools.Win32
         /// <returns></returns>
         public static int StrictNext(this Random r, int seed = Int32.MaxValue)
         {
-            byte[] b = new byte[4];
-            new RNGCryptoServiceProvider().GetBytes(b);
-            return new Random(BitConverter.ToInt32(b, 0)).Next(seed);
+            return new Random((int)Stopwatch.GetTimestamp()).Next(seed);
         }
 
         /// <summary>