[求助]asp怎样像360卫士那样点击后自动获取一段激活码?
最近公司想做一种像360卫士那样,点击获取激活码,网站即给出随机一段激活码,让客户激活其产品。可我没做过不会做,给个思路吧,或者懂得说一下。。先谢过了。。
激活码是通过一定算法得到的
如果只是一个随机的字符串那简单啊
取得随机字符,参数PasswordLen是字符长度
Function GetRndPassword(PasswordLen)
Dim Ran, i, strPassword
strPassword = ""
For i = 1 To PasswordLen
Randomize
Ran = CInt(Rnd * 2)
Randomize
If Ran = 0 Then
Ran = CInt(Rnd * 25) + 97
strPassword = strPassword & UCase(Chr(Ran))
ElseIf Ran = 1 Then
Ran = CInt(Rnd * 9)
strPassword = strPassword & Ran
ElseIf Ran = 2 Then
Ran = CInt(Rnd * 25) + 97
strPassword = strPassword & Chr(Ran)
End If
Next
GetRndPassword = strPassword
End Function