[唐胡璐]VBS技巧 - Generate Random String(产生随机数)

 Function RandomString( ByVal strLen )     

    Dim str     
    Const LETTERS = "abcdefghijklmnopqrstuvwxyz0123456789"

    For i = 1to strLen      
        str = str & Mid( LETTERS, RandomNumber( 1, Len( LETTERS ) ), 1 )     
    Next     

    RandomString = str

EndFunction

posted @ 2013-01-11 11:36  唐胡璐  阅读(227)  评论(0编辑  收藏  举报