Utilities.GetRandom method
[The GetRandom method is available for use in the operating systems specified in the Requirements section.]
Applies to: desktop apps only
The GetRandom method generates a secure random number using the default cryptographic service provider (CSP).
Syntax
Utilities.GetRandom( _ [ ByVal Length ], _ [ ByVal EncodingType ] _ )
Parameters
- Length [in, optional]
-
The length, in bytes, of the random number to create. The default value is 8 bytes.
- EncodingType [in, optional]
-
A value of the CAPICOM_ENCODING_TYPE enumeration that indicates the type of encoding to use for the generated random number. The default value is CAPICOM_ENCODE_BINARY. This parameter can be one of the following values.
Return value
A randomly generated number Length bytes long, with the specified encoding.
Requirements
|
Redistributable | CAPICOM 2.0 or later on Windows Server 2003, Windows XP, Windows 2000 Server with SP3 and later, and Windows 2000 Professional with SP3 and later |
|---|---|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 3/6/2012