Fills the elements of a specified array of bytes with random numbers.
Assembly: mscorlib (in mscorlib.dll)
Each element of the array of bytes is set to a random number greater than or equal to zero, and less than or equal to MaxValue.
To generate a cryptographically secured random number suitable for creating a random password, for example, use a method such as RNGCryptoServiceProvider.GetBytes.Notes to Inheritors
If you derive a class from Random and override the Sample method, the distribution provided by the derived class implementation of the Sample method is not used in calls to the base class implementation of the method. Instead, the uniform distribution returned by the base Random class is used. This behavior improves the overall performance of the Random class. To modify this behavior to call the Sample method in the derived class, you must also override the method.
The following code example demonstrates how to use the method to fill an array of bytes with random byte values.
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.