Wednesday, 16 January 2013

Creating a Random String Using VB Script

Function RandomString( ByVal strLen )        Dim str
       Const LETTERS = "abcdefghijklmnopqrstuvwxyz"
       For i = 1 to strLen
                   str = str & Mid( LETTERS, RandomNumber( 1, Len( LETTERS ) ), 1 )   
       Next 
        RandomString = str
  End Function

No comments:

Post a Comment