转载:http://blog.csdn.net/chenyujing1234/article/details/7695020
1、延时的办法。
可以采用for循环的办法,也可以采用Thread.Sleep(100);
2、提高随机数不重复概率的种子生成方法:
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( ) );