Funcion para generar texto aleatorio ASP clásico
Código ASP clásico
- Por Programador ASP clásico /
- 07/08/2012 @ 13:39:52 /
- 1179 visitas
La siguiente función permite generar texto aleatorio:
<%
'***P13 Random Text v1.2 by Ferruh Mavituna
'//NFO//
' Generate random texts by select lenght and pattern
'//ARGUMENTS//
' lenght : Lenght of string will be generate
' rp_chars : Adds Special pattern for generate
' lcases : Include Lowercase Characters (1=active/0=deactive)
' ucases : Include Uppercase Characters (1=active/0=deactive)
' exchars : Include Extra Characters (1=active/0=deactive)
' numbers : Include Numbers(1=active/0=deactive)
'//SAMPLES//
' Response.Write P13_RandomPass(7,"p13studio",0,0,0,0)
' This will generate some random texts just from p,1,3,s,t,d,i,o and this texts lenght is 7
' Response.Write P13_RandomPass(10,"*+-",1,1,0,0)
' This will generate some random texts just from lowercases, uppercases, and *,+,- also this texts lenght is 10
Function P13_RandomPass(lenght,rp_chars,lcases,ucases,exchars,numbers)
Dim rp_lchars, rp_uchars, rp_,rp_ranval, rp_RndInt, rp_exchars, rp_numbers
If lenght = 0 Then lenght = 7
rp_lchars = "abcdefghijklmnopqrstuvwxyz"
rp_uchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
rp_exchars = "`~!@#$%^&*()-_=+[{]}\\|;:"""'\,<.>/? "
rp_numbers = "0123456789"
If lcases = 1 Then rp_chars = rp_chars & rp_lchars
If ucases = 1 Then rp_chars = rp_chars & rp_uchars
If exchars = 1 Then rp_chars = rp_chars & rp_exchars
If numbers = 1 Then rp_chars = rp_chars & rp_numbers
If rp_chars = "" Then rp_chars = "p13studio"
For i = 1 to lenght
Randomize Timer
rp_RndInt = Int(Rnd*Len(rp_chars)+1)
rp_ranval = rp_ranval & Mid(rp_chars,rp_RndInt,1)
Next
P13_RandomPass = rp_ranval
End Function
Special Variable Writer%>
tags: email marketing, email masivo, ofuscar email
En esta sección encontrarás una mezcla de códigos recopilados de fuentes públicas de Internet y otros creados por ASP TEAM. Compartimos recursos útiles de buena fe para formar una base de conocimiento en el desarrollo de aplicaciones en ASP Clásico.