lunedì 23 ottobre 2017

Centralino IP PBX su Windows - 3CX Phone System which links here: http://www.3cx.it/centralino/index.html

 

 

RSS Feed RSS Feed

Login

Newsletter Newsletter

Registrati

RisorseGuide e Articoli

 

31

A volte, per diverse funzionlità, si richiede la generazione di password sia a lunghezza fissa che variabile.
Questo script genera password randomiche.
(maxi_1972@hotmail.com)

 

<% Option Explicit %>

<%

Dim X

Response.Write "<HTML>" & vbCrLf

Response.Write "<HEAD>" & vbCrLf

Response.Write "</HEAD>" & vbCrLf

Response.Write "<BODY>" & vbCrLf

Response.Write "<FONT FACE=COURIER>" & vbCrLf

Response.Write "<B>Fixed length (10 characters) passwords</B><BR>" & vbCrLf

For X = 0 To 20

Response.Write RandomPW(10) & "<br>" & vbCrLf

Next

Response.Write "<BR><BR><B>Random length passwords</B><BR>" & vbCrLf

For X = 0 To 20

'Set Length to 0 for random password Length

Response.Write RandomPW(0) & "<br>" & vbCrLf

Next

Response.Write "</FONT>" & vbCrLf

Response.Write "</BODY>" & vbCrLf

Response.Write "</HTML>" & vbCrLf

Function RandomPW(myLength)

'These constant are the minimum and maximum length for random

'length passwords. Adjust these values to your needs.

Const minLength = 6

Const maxLength = 20

Dim X, Y, strPW

If myLength = 0 Then

Randomize

myLength = Int((maxLength * Rnd) + minLength)

End If


For X = 1 To myLength

'Randomize the type of this character

Y = Int((3 * Rnd) + 1) '(1) Numeric, (2) Uppercase, (3) Lowercase

Select Case Y

Case 1

'Numeric character

Randomize

strPW = strPW & CHR(Int((9 * Rnd) + 48))

Case 2

'Uppercase character

Randomize

strPW = strPW & CHR(Int((25 * Rnd) + 65))

Case 3

'Lowercase character

Randomize

strPW = strPW & CHR(Int((25 * Rnd) + 97))

End Select

Next

RandomPW = strPW

End Function

%>


Scritto in: Script
AZIONI: E-mail | Permalink |
CONDIVIDI: del.icio.us   Facebook   Digg   Google   Live Bookmarks   Newsvine   StumbleUpon   Technorati   Yahoo   DotNetKicks
blog comments powered by Disqus

Copyright 2011 by SysAdmin.it