NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Random.Next (Int32)

Returns a positive random number less than the specified maximum.

[Visual Basic]
Overloads Overridable Public Function Next( _
   ByVal maxValue As Integer _
) As Integer
[C#]
public virtual int Next(
   int maxValue
);
[C++]
public: virtual int Next(
   int maxValue
);
[JScript]
public function Next(
   maxValue : int
) : int;

Parameters

maxValue
The upper bound of the random number to be generated. maxValue must be an integer number greater than or equal to 0 and less than or equal to Int32.Max

Return Value

A number greater than or equal to 0 and less than maxValue.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException if maxValue is less than zero.

Remarks

The seed is adjusted as a side effect of this call. Successive calls to Next will yield different numbers.

See Also

Random Class | Random Members | System Namespace | Random.Next Overload List