asp 随机字符串函数
更新时间:2009年01月13日 12:09:59 作者:
这个方法不错,可以生成小写字符跟数字的随机字符串,大家可以加入一些特殊字符和一些大写字母等。
'*************************************
'asp计算随机数
'*************************************
Function randomStr(intLength)
Dim strSeed, seedLength, pos, Str, i
strSeed = "abcdefghijklmnopqrstuvwxyz1234567890"
seedLength = Len(strSeed)
Str = ""
Randomize
For i = 1 To intLength
Str = Str + Mid(strSeed, Int(seedLength * Rnd) + 1, 1)
Next
randomStr = Str
End Function
'asp计算随机数
'*************************************
Function randomStr(intLength)
Dim strSeed, seedLength, pos, Str, i
strSeed = "abcdefghijklmnopqrstuvwxyz1234567890"
seedLength = Len(strSeed)
Str = ""
Randomize
For i = 1 To intLength
Str = Str + Mid(strSeed, Int(seedLength * Rnd) + 1, 1)
Next
randomStr = Str
End Function
相关文章
ASP中Server.Execute和Execute实现动态包含(include)脚本的区别
ASP中Server.Execute和Execute实现动态包含(include)脚本的区别,需要的朋友可以参考下。2012-01-01
ASP+FSO生成的网页文件默认编码格式以及转换成UTF-8编码方法
有一个客人的网站想做一个俄文版,前台后台,我统一用utf-8编码,但通过数据库生成的静态俄文信息是乱码。如果用GB2312显示,通过数据库生成的静态俄文信息正确显示, 但模板文件俄文是乱码。2009-11-11
分享一段代码show.asp?id=26变成show/?26的形式
这篇文章主要介绍了分享一段代码show.asp?id=26变成show/?26的形式,需要的朋友可以参考下2006-11-11


最新评论