当前位置:   article > 正文

随机生成数字字母_易语言随机生成字母加数字

易语言随机生成字母加数字

Function makePassword(maxLen)
Dim strNewPass
Dim whatsNext, upper, lower, intCounter
Randomize
For intCounter = 1 To maxLen
whatsNext = Int((1 - 0 + 1) * Rnd + 0)
If whatsNext = 0 Then
'character
upper = 90
lower = 65
Else
upper = 57
lower = 48
End If
strNewPass = strNewPass & Chr(Int((upper - lower + 1) * Rnd + lower))
Next
makePassword = strNewPass
End Function 

'随机产生编号

 numaz="" dim num20(19)

 For j=0 to 19

 Do

 Randomize

asciicode=Int((122 - 48 + 1) * Rnd + 48)

Loop Until asciicode<=57 or (65<=asciicode and asciicode<=90) or 97<=asciicode

num20(j)=chr(asciicode)

Next

numaz=Join(num20,"")
 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/238792
推荐阅读
相关标签
  

闽ICP备14008679号