'''' 函数ID:0040[生成验证码图像BMP] '''' '''' 函数ID:0041[生成随机密码] '''' '''' 函数ID:0042[字符加解密] '''' '''' 函数ID:0043[解密字符加解密] '''' '''' 函数ID:0044[创建数据表] '''' '''' 函数ID:0045[在数据库中插入字段值] '''' '''' 函数ID:0046[Cookie防乱码写入时用] '''' '''' 函数ID:0047[Cookie防乱码读出时用] '''' '''' 函数ID:0048[检测用户名和密码是否正确] '''' '''' 函数ID:0049[生成时间的整数] '''' '''' 函数ID:0050[获得栏目的所有子栏目字符串并用","隔开] '''' '''' '''' '''' '''' '''' '**************************************************'''' '函数ID:0001[截字符串] '函数名:SubstZFC '作 用:截字符串,汉字一个算两个字符,英文算一个字符 '参 数:str ----原字符串 ' strlen ----截取长度 '返回值:截取后的字符串 '************************************************** Public Function SubstZFC(ByVal str, ByVal strlen) If str = "" Then SubstZFC = "" Exit Function End If Dim l, t, c, i, strTemp str = Replace(Replace(Replace(Replace(str, " ", " "), """, Chr(34)), ">", ">"), "<", "<") l = Len(str) t = 0 strTemp = str strlen = CLng(strlen) For i = 1 To l c = Abs(Asc(Mid(str, i, 1))) If c > 255 Then t = t + 2 Else t = t + 1 End If If t >= strlen Then strTemp = Left(str, i) Exit For End If Next SubstZFC = Replace(Replace(Replace(Replace(strTemp, " ", " "), Chr(34), """), ">", ">"), "<", "<") End Function '************************************************** '函数ID:0002[过滤html] '函数名:GlHtml '作 用:过滤html 元素 '参 数:str ---- 要过滤字符 '返回值:没有html 的字符 '************************************************** Public Function GlHtml(ByVal str) If IsNull(str) Or Trim(str) = "" Then GlHtml = "" Exit Function End If Dim re Set re = New RegExp re.IgnoreCase = True re.Global = True re.Pattern = "(\<.[^\<]*\>)" str = re.Replace(str, " ") re.Pattern = "(\<\/[^\<]*\>)" str = re.Replace(str, " ") Set re = Nothing str = Replace(str, "'", "") str = Replace(str, Chr(34), "")
如果您对本文有任何疑问或者建议,请到讨论区发表您的意见:
>>
论坛入口 <<
上一页 1 23 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 下一页
上一篇:SubSonic 的字段名未转义问题修正 下一篇:关于分页查询和性能问题
|