一段随机英文+数字的过程

一段随机英文+数字的过程,过程只有一个参数,传递位数的长度

ASP/Visual Basic 代码
 
  1. <%   
  2. ' 随机英文+数字   
  3. Function GetRamCode(f_number)   
  4.  Randomize   
  5.  Dim f_Randchar,f_Randchararr,f_RandLen,f_Randomizecode,f_iR   
  6.  f_Randchar="0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"  
  7.  f_Randchararr=split(f_Randchar,",")   
  8.  f_RandLen=f_number '定义密码的长度或者是位数   
  9.  for f_iR=1 to f_RandLen   
  10.   f_Randomizecode=f_Randomizecode&f_Randchararr(Int((21*Rnd)))   
  11.  next   
  12.  GetRamCode = f_Randomizecode   
  13. End Function  
  14. %>  

 



评论: 0 | 引用: 0 | 查看次数: 849 | 返回顶部
发表评论
昵 称:  
验证码:  
内 容: