Export (0) Print
Expand All

RNGCryptoServiceProvider.GetBytes Method

Fills an array of bytes with a cryptographically strong sequence of random values.

Namespace:  System.Security.Cryptography
Assembly:  mscorlib (in mscorlib.dll)

[SecuritySafeCriticalAttribute]
public override void GetBytes(
	byte[] data
)

Parameters

data
Type: System.Byte[]
The array to fill with a cryptographically strong sequence of random values.

ExceptionCondition
CryptographicException

The cryptographic service provider (CSP) cannot be acquired.

ArgumentNullException

data is null.

The length of the byte array determines how many cryptographically strong random bytes are produced.

This method is thread safe.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft