Simple Password Generator (zSPG v1.0)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PatrikB
    Medlem
    • 2000-03-31
    • 2713

    #1

    Simple Password Generator (zSPG v1.0)

    Ett mycket enkelt password generator:
    [kod]
    '-----------------------------------------------------------------------------
    ' Create a password
    '-----------------------------------------------------------------------------
    '########################################################### ##################
    '#
    '# SCRIPT NAME: zSPG v1.0b (Simple Password Generator v1.0 beta)
    '# -------------------------------------------------------------
    '#
    '# ---------------------------
    '# Programmer: Patrik Berggren
    '# ---------------------------
    '#
    '# Date Created: 28 September, 2000
    '#
    '# -------
    '# Contact
    '# =======
    '# Email: [email protected]
    '# Homepagettp://www.mrwize.nu
    '#
    '# ****** DISCLAIMER ******
    '#
    '# This script is FREEware and can not be sold in any form like:
    '#
    '# 1: zip-archives
    '# 2: CD-Rom
    '# 3: Discette
    '# 4: by Download
    '# 5: or any other archives.
    '#
    '#
    '# No warranty, support etc. is given. Use at your own risc.
    '#
    '# ****** DISCLAIMER ******
    '#
    '########################################################### ##################
    Function MakePwd(ByRef intPwdLength)
    Dim strLetter
    Dim arrLetter
    Dim t_Pwd
    Dim i
    Dim intLetter

    Randomize

    ' Character to build password with.
    ' OBS!!! Use only valid charachters.
    '-----------------------------------
    strLetter ="A,B,C,D,E,F,G,H,I,J,K,L,M,n,o,p,q,r,s,t,u,v,w,x,y,z," & _
    "0,1,2,3,4,5,6,7,8,9,N,O,P,Q,R,S,T,U,V,W,X,Y,Z," & _
    "a,b,c,d,e,f,g,h,i,j,k,l,m,"

    ' Create an array with all valid chars
    '--------------------------------------
    arrLetter = Split(strLetter,",")

    ' Builds a password with chosed length
    '-------------------------------------
    For i = 1 To intPwdLength
    intLetter = CInt(RND * UBound(arrLetter))
    t_Pwd = t_Pwd & arrLetter(intLetter)
    Next

    MakePwd = t_Pwd
    End Function
    [/kod]
    ex:
    För att generera ett password:
    <font size="1" face="Verdana, Arial, Helvetica, sans-serif">Kod:[/kod]<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#006666">
    strPassword = MakePwd(10)
    [/kod]
    Där 10 står för hur långt passwordet ska vara.

    cya,
    PatrikB

    ------------------
    =================================
    ** ZWGdesign **
    =================================
Working...