GetBytes Method
Collapse the table of content
Expand the table of content

RNGCryptoServiceProvider.GetBytes Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

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

'Declaration
Public Overrides Sub GetBytes ( _
	data As Byte() _
)

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 Nothing.

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

This method is thread safe.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft