Previous Topic

Next Topic

Book Contents

Book Index

VBScript Web Password Sample Code

Many web server applications need to generate secure, temporary passwords for new users. Really Random Numbers includes a simple COM programming interface so you can get secure random numbers into your web code with just 3 or 4 lines of code.

Here's some sample VBScript code for generating a random alphanumeric password:

' Define variables
Dim objGenerator, strPassword
' Create generator object
Set objGenerator = CreateObject("RandomNumbers.Generator")
' Get a password and check for error:
strPassword = objGenerator.RandomCharacters("1234567890abcdefghijklmnopqrstuvwxyz")
' Error handling:
If strPassword = "_ERROR" Then
' Implement error handling here.
End If

See Also

Using the COM Interface

MS Visual Basic Sample Code

MS Excel VBA Sample Code

MS Visual C++ Sample Code