Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
using System;
namespace RandomNum
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
Random random =new Random();
for(int i=0; i<10; i++) {
Console.WriteLine(random.Next());
}
}
}
}
Random random1 = new Random((int)DateTime.Now.Ticks));
Random random2 = new Random(~(int)DateTime.Now.Ticks)); // bitwise operator
using System.Security.Cryptography;
RNGCryptoServiceProvider rng = New RNGCryptoServiceProvider();
byte[] ra = new Byte[500];
rng.GetBytes(ra);
// ra now has 500 strong random bytes
// Take first 4 bytes and convert to a 32-bit integer
int randValue = BitConverter.ToInt32(ra, 0);