C#提高随机数不重复概率的种子生成方法

c#
2015-05-02 0 276
C#提高随机数不重复概率的种子生成方法

C#提高随机数不重复概率的种子生成方法

static int GetRandomSeed( )
{
         byte[] bytes = new byte[4];
       System.Security.Cryptography.RNGCryptoServiceProvider rng = new       System.Security.Cryptography.RNGCryptoServiceProvider( );
       rng.GetBytes( bytes );
       return BitConverter.ToInt32( bytes , 0 );
}
Random random = new Random( GetRandomSeed( ) );

遇见资源网 c# C#提高随机数不重复概率的种子生成方法 http://www.ox520.com/12618.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务