using System.Security.Cryptography;
public static void Main()
RandomNumberGenerator randomNumberGenerator = RandomNumberGenerator.Create();
randomNumberGenerator.GetBytes(bytes);
uint random = BitConverter.ToUInt32(bytes, 0) % 1000000;
string result = String.Format("{0:D}", random);
Console.WriteLine(result);