1 static int GetRandomSeed() 2 { 3 byte[] bytes = new byte[4]; 4 System.Security.Cryptography.RNGCryptoServiceProvider rng = new System.Security.Cryptography.RNGCryptoServiceProvider(); 5 rng.GetBytes(bytes); 6 return BitConverter.ToInt32(bytes, 0); 7 } 8 9 static int GetNumber() 10 { 11 return Math.Abs(GetRandomSeed()); 12 }