nbgzc
using System;
using System.Collections.Generic;
using System.Text;

namespace Guaerjia.Utils
{
    public class GuidRandom
    {
        public static int GetKey()
        {
            return Guid.NewGuid().GetHashCode();
        }

        public static int Next()
        {
            Random ran = new Random(GetKey());
            return ran.Next();
        }

        public static int Next(int maxValue)
        {
            Random ran = new Random(GetKey());
            return ran.Next(maxValue);
        }

        public static int Next(int minValue, int maxValue)
        {
            Random ran = new Random(GetKey());
            return ran.Next(minValue, maxValue);
        }

        public static double NextDouble()
        { 
            Random ran = new Random(GetKey());
            return ran.NextDouble();
        }
    }
}

分类:

技术点:

相关文章: