ASP常用函数收藏乱七八糟未整理版(70)
'功能:生成随机密码
'参数:intLen新密码长度
'PassMask生成密码的掩码默认为空
'返 回 值:无
'涉及的表:无
'===================================================================================
Public Function GenPassword(intLen, PassMask)
Dim iCnt, PosTemp
Randomize
If PassMask = "" Then
PassMask = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"
End If
For iCnt = 1 To intLen
PosTemp = Fix(Rnd(1) * (Len(PassMask))) + 1
GenPassword = GenPassword & Mid(PassMask, PosTemp, 1)
Next
End Function
'===================================================================================
' 函数原型:GenSerialString ()
'功能:生成序列号
'参数:无
'返 回 值:无
'涉及的表:无
'===================================================================================
Public Function GenSerialString()
GenSerialString = Year(Now())
If Month(Now())<10 Then
GenSerialString = GenSerialString & "0"
End If
GenSerialString = GenSerialString & Month(Now())
If Day(Now())<10 Then
GenSerialString = GenSerialString & "0"
End If
GenSerialString = GenSerialString & Day(Now())
If Hour(Now())<10 Then
GenSerialString = GenSerialString & "0"
End If
GenSerialString = GenSerialString & Hour(Now())
If Minute(Now())<10 Then
GenSerialString = GenSerialString & "0"
End If
GenSerialString = GenSerialString & Minute(Now())
If Second(Now())<10 Then
GenSerialString = GenSerialString & "0"
End If
GenSerialString = GenSerialString & Second(Now())
内容版权声明:除非注明,否则皆为本站原创文章。