RandomHelper.cs 370 B

1234567891011121314
  1. namespace UniformMaterialManagementSystem.Utils
  2. {
  3. public static class RandomHelper
  4. {
  5. public static int CreateRandom(int count)
  6. {
  7. var buffer = Guid.NewGuid().ToByteArray();
  8. var iRoot = BitConverter.ToInt32(buffer);
  9. var random = new Random(iRoot);
  10. return random.Next() % count;
  11. }
  12. }
  13. }