Get Random Int - CSharp System

CSharp examples for System:Random

Description

Get Random Int

Demo Code


using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from ww w  . j a va 2  s  . com*/

public class Main{
        public static int GetRandomInt()
        {
            Random ran = new Random(DateTime.Now.Millisecond);
            return ran.Next();
        }
}

Related Tutorials