Returns a nonnegative random integer that is less than the specified maximum.
Syntax
public virtual
int Next (
int maxValue)
Parameters
- maxValue
-
The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to zero.
Returns
A 32-bit signed integer greater than or equal to zero, and less than maxValue; that is, the range of return values ordinarily includes zero but not maxValue. However, if maxValue equals zero, maxValue is returned.
Exceptions
Remarks
Requirements
Namespace: System
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0