provided by: 
Originally published at Internet.comIf you are a little like I am you will be doing something with your computer even during the holidays. (More than likely I will be playing Red Alert 2 with the kids, but I may sneak in a little writing.) For you workaholics, I have included a little holiday fare. This way you will be able to do something constructive, yet be able to tear yourself away when company comes knocking on the door.
Random numbers are commonly employed in applications for a wide variety of reasons. In this week's letter let's take a quick look at the Random class in the Common Language Runtime.
The System Namespace
The System namespace is a root namespace in the Common Language Runtime (CLR). One of the classes in the System namespace is the Random class. (That's right! Random numbers are encapsulated in a class in .NET.) Like VB6 random numbers are based on a mathematical algorithm from a finite set of numbers. The result is that you get pseudo-random numbers, but these numbers are random enough for many practical purposes (just not the lottery).
Random numbers in VB.NET can be initialized with or without a seed value and can be constrained to a range of numbers. If the same seed is used then the generated number sequence will be identical. A good strategy is to seed the random numbers using a unique value like the time. Table 1 describes the members of the Random class and is followed by some code examples demonstrating how to use the Random class. Members of the System.Random class. Member Name Description New() Constructs instance of Random Class. New(ByVal Seed As Integer) Constructs instance of Random class using Seed value. Next() As Integer Returns next integer in the random number sequence. Next(ByVal maxValue As Integer) As Integer Returns a positive integer less than maxValue. Next(ByVal minValue As Integer, ByVal maxValue As Integer) As Integer Returns a number greater than or equal to minValue and less than or maxValue. NextBytes(ByVal buffer() As Byte) Returns an array of random bytes greater than or equal to 0 and less than Byte.MaxValue. NextDouble() As Double Returns a random Double between 0.0 and 1.0...
Read article at Internet.com site