Mono Class Library: System.Random Overview | Members

System.Random.Next Method

Returns a psuedo-random number within a specified range. [Edit]

public virtual int Next (int minValue, int maxValue)

Parameters

minValue
The lower bound of the random number returned. [Edit]
maxValue
The upper bound of the random number returned. [Edit]

Returns

A psuedo-random number greater than or equal to minValue and less than maxValue. If minValue and maxValue are equal, this value is returned. [Edit]

Exceptions

TypeReason
ArgumentOutOfRangeExceptionminValue is greater than maxValue. [Edit]

Remarks

Operation
As described above.

Note to Inheritors
Override this method to customize the algorithm used to generate the return value.

Usage
Use this method to generate psuedo-random numbers in a specified range.

[Edit]

Requirements

Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0