get Random Number in a range - CSharp System

CSharp examples for System:Random

Description

get Random Number in a range

Demo Code


using System.Web;
using System.Reflection;
using System.Linq;
using System.Data;
using System.Collections.Generic;
using System;//from w  w  w.  j  a v  a2 s  .  co m

public class Main{
    public static int getRandomNumber(int min, int max)
      {
         Random random = new Random();
         return random.Next(min, max);
      }
}

Related Tutorials