Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Password Generator

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,28129
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Password Generator
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Password Generator - 11/18/2005 6:38:04 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
'quick and dirty password generator

'start main sub
Main()

sub Main()
    Dim length
    length = ""
    'get input for length of the password
    length = InputBox("Please enter the password length (min 8, max 100):","Password Generator","8")
    'check for errors in input
    if length = "" Then
        'start over if so
        MsgBox("Incorrect entry, try again.")
        Main()
    Elseif Not IsNumeric(length) Then
        'start over if so
        MsgBox("Incorrect entry, try again.")
        Main()
    Elseif length > 100 Or length < 8 Then
        'start over if so
        MsgBox("Incorrect entry, try again.")
        Main()
    Else
    'use an inputbox so they user can copy/paste their password
    answer = inputbox("Copy and paste your password below.","Password Generator",genPasswd(length))
    end If
end sub 'Main

function genPasswd(input)
    'initialize the random function
    Randomize
    'create each digit up to the length specified
    For i = 1 To input
        'uses most of the ascii characters, even spaces!
        digit = Int((95 * Rnd) + 32)
    final = final & chr(digit)
    Next
    'return password
    genPasswd = final
End function 'genPasswd

< Message edited by kirrilian -- 11/18/2005 7:07:38 AM >


_____________________________

Have you searched here ?
VBScript Fundamentals
My Site
 
 
Revisions: 1 | Post #: 1
 
 RE: Password Generator - 11/18/2005 7:08:17 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
damn logic 

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to kirrilian)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Password Generator Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts