国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > ASP > 正文

Asp中隨機產生用戶密碼的代碼

2024-05-04 10:58:01
字體:
來源:轉載
供稿:網友
隨機產生用戶密碼(good),說明:通過隨機產生密碼,然后將密碼EMail給注冊用戶,你可以確認用戶的EMail填寫是否正確。 
說明:通過隨機產生密碼,然后將密碼EMail給注冊用戶,你可以確認用戶的EMail填寫是否正確。自動產生的密碼往往安全性更高,同時,你可以過濾那些無效的用戶。   
  把下面的代碼保存為random.asp文件: 
復制代碼 代碼如下:

<%  
Sub StrRandomize(strSeed)  
  Dim i, nSeed   
  nSeed = CLng(0)  
  For i = 1 To Len(strSeed)  
    nSeed = nSeed Xor ((256 * ((i - 1) Mod 4) * AscB(Mid(strSeed, i, 1))))  
  Next  
  Randomize nSeed  
End Sub  
Function GeneratePassword(nLength)  
  Dim i, bMadeConsonant, c, nRnd  
  Const strDoubleConsonants = "bdfglmnpst"  
  Const strConsonants = "bcdfghklmnpqrstv"  
  Const strVocal = "aeiou"  
  GeneratePassword = ""  
  bMadeConsonant = False  
  For i = 0 To nLength  
    nRnd = Rnd  
    If GeneratePassword <> "" AND (bMadeConsonant <> True) AND (nRnd < 0.15) Then  
      c = Mid(strDoubleConsonants, Int(Len(strDoubleConsonants) * Rnd + 1), 1)  
      c = c & c  
  i = i + 1  
      bMadeConsonant = True  
    Else  
      If (bMadeConsonant <> True) And (nRnd < 0.95) Then  
        c = Mid(strConsonants, Int(Len(strConsonants) * Rnd + 1), 1)  
        bMadeConsonant = True  
      Else  
        c = Mid(strVocal,Int(Len(strVocal) * Rnd + 1), 1)  
        bMadeConsonant = False  
      End If  
    End If  
    GeneratePassword = GeneratePassword & c  
  Next  
  If Len(GeneratePassword) > nLength Then  
    GeneratePassword = Left(GeneratePassword, nLength)  
  End If  
End Function  
%>  
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 镇巴县| 灌阳县| 高台县| 宁强县| 通许县| 博爱县| 洪江市| 太湖县| 封开县| 简阳市| 龙门县| 磐石市| 临安市| 吕梁市| 芷江| 敦煌市| 富阳市| 弥渡县| 城口县| 沁阳市| 收藏| 枣庄市| 新民市| 合川市| 广水市| 保山市| 城市| 库车县| 江达县| 化州市| 虞城县| 松江区| 桦甸市| 丰都县| 吉林省| 蒙自县| 焉耆| 延长县| 乌兰察布市| 东源县| 宁强县|