July 2002
Beginner
720 pages
14h 35m
English
The System.Random class serves as a pseudo-random number generator. We can use this class to get a random number – either decimal or whole random numbers. To generate such numbers we can use the Next()method to return a random number, NextDouble() to return a Double random number between 0.0 and 1.0 (the number will be greater than or equal to 0.0 and less than 1.0), or NextBytes(Byte() ) to fill the elements of a specified array of bytes with random numbers. The following example illustrates how to use these methods to generate random numbers – both Double and Integers:
'--------------------------------------- ' .NET System.Random Class Demo '--------------------------------------- Imports System Module Cons Sub Main() ...
Read now
Unlock full access