【asp 随机字符串函数】教程文章相关的互联网学习教程文章

asp 随机字符串函数

'************************************* '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生成随机字符串(数字+大小写字母)的代码

<% 'ASP生成随机字符串(数字+大小写字母)练习 '阿会楠练习,为我所用,非我所想 Function randKey(obj) Dim char_array(80) Dim temp For i = 0 To 9 char_array(i) = Cstr(i) Next For i = 10 To 35 char_array(i) = Chr(i + 55) Next For i = 36 To 61 char_array(i) = Chr(i + 61) Next Randomize For i = 1 To obj 'rnd函数返回的随机数在0~1之间,可等于0,但不等于1 '公式:int((上限-下限+1)*Rnd+下限...