ASP常用函数收藏乱七八糟未整理版(44)
Else
Islefted = True
Exit For
End If
Next
If Islefted Then
str2 = str2 & ".."
End If
cleft = str2
End Function
Function MyRandc(n) '生成随机字符,n为字符的个数
Dim thechr
thechr = ""
For i = 1 To n
Dim zNum, zNum2
Randomize
zNum = CInt(25 * Rnd)
zNum2 = CInt(10 * Rnd)
If zNum2 Mod 2 = 0 Then
zNum = zNum + 97
Else
zNum = zNum + 65
End If
thechr = thechr & Chr(zNum)
Next
MyRandc = thechr
End Function
Function MyRandn(n) '生成随机数字,n为数字的个数
Dim thechr
thechr = ""
For i = 1 To n
Dim zNum, zNum2
Randomize
zNum = CInt(9 * Rnd)
zNum = zNum + 48
thechr = thechr & Chr(zNum)
Next
MyRandn = thechr
End Function
Function formatQueryStr(Str) '格式化sql中的like字符串
Dim nstr
nstr = Str
nstr = Replace(nstr, Chr(0), "")
nstr = Replace(nstr, "'", "''")
nstr = Replace(nstr, "[", "[[]")
nstr = Replace(nstr, "%", "[%]")
内容版权声明:除非注明,否则皆为本站原创文章。