[VB6 equivalent: RNG_Initialize]
Dim strSeedFile As String
Dim isOK As Boolean
Dim abData() As Byte
Dim nDataLen As Integer
Dim i As Integer
strSeedFile = "seed.dat"
' 1. Initialize
isOK = Rng.Initialize(strSeedFile)
Console.WriteLine("Rng.Initialize('" & strSeedFile & "') returns " & isOK & " (expecting True)")
' 2. Generate some random data
nDataLen = 24
For i = 1 To 3
abData = Rng.Bytes(nDataLen)
Console.WriteLine(Cnv.ToHex(abData))
Next
' 3. Update the seed file
isOK = Rng.UpdateSeedFile(strSeedFile)
Console.WriteLine("Rng.UpdateSeedFile('" & strSeedFile & "') returns " & isOK & " (expecting True)")
See Also:
Rng.Initialize Method