- <%
- '******************************
- '函数:CheckQuery(ByVal str)
- '参数:str ----搜索的字符串
- '作者:阿里西西
- '日期:2007/7/15
- '描述:限制搜索的关键字
- '示例:CheckQuery(str)
- '******************************
- Public Function CheckQuery(ByVal str)
- Dim FobWords, i, keyword
- keyword = str
- On Error Resume Next
- FobWords = Array(91, 92, 304, 305, 430, 431, 437, 438, 12460, 12461, 12462, 12463, 12464, 12465, 12466, 12467, 12468, 12469, 12470, 12471, 12472, 12473, 12474, 12475, 12476, 12477, 12478, 12479, 12480, 12481, 12482, 12483, 12485, 12486, 12487, 12488, 12489, 12490, 12496, 12497, 12498, 12499, 12500, 12501, 12502, 12503, 12504, 12505, 12506, 12507, 12508, 12509, 12510, 12532, 12533, 65339, 65340)
- For i = 1 To UBound(FobWords, 1)
- If InStr(keyword, ChrW(FobWords(i))) > 0 Then
- CheckQuery = False
- Exit Function
- End If
- Next
- FobWords = Array("~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "=", "`", "[", "]", "{", "}", ";", ":", """", "'", "<", ">", ".", "/", "\", "|", "?", "about", "after", "all", "also", "an", "and", "another", "any", "are", "as", "at", "be", "because", "been", "before", "being", "between", "both", "but", "by", "came", "can", "come", "could", "did", "do", "each", "for", "from", "get", "got", "had", "has", "have", "he", "her", "here", "him", "himself", "his", "how", "if", "in", "into", "is", "it", "like", "make", "many", "me", "might", "more", "most", "much", "must", "my", "never", "now", "of", "on", "only", "or", "other", "our", "out", "over", "said", "same", "see", "should", "since", "some", "still", "such", "take", "than", "that", "the", "their", "them", "then", "there", "these", "they", "this")
- keyword = Left(keyword, 100)
- keyword = Replace(keyword, "!", " ")
- keyword = Replace(keyword, "]", " ")
- keyword = Replace(keyword, "[", " ")
- keyword = Replace(keyword, ")", " ")
- keyword = Replace(keyword, "(", " ")
- keyword = Replace(keyword, " ", " ")
- keyword = Replace(keyword, "-", " ")
- keyword = Replace(keyword, "/", " ")
- keyword = Replace(keyword, "+", " ")
- keyword = Replace(keyword, "=", " ")
- keyword = Replace(keyword, ",", " ")
- keyword = Replace(keyword, "'", " ")
- For i = 0 To UBound(FobWords, 1)
- If keyword = FobWords(i) Then
- CheckQuery = False
- Exit Function
- End If
- Next
- CheckQuery = True
- End Function
- %>
asp实现限制搜索的关键字的函数
2019-10-11 10:42asp代码网 ASP教程
asp实现限制搜索的关键字的函数
延伸 · 阅读
- 2022-03-11Python 函数装饰器应用教程
- 2022-03-11Python全栈之文件函数和函数参数
- 2022-03-10C++ 函数的介绍
- 2022-03-10Java关键字之instanceof详解
- 2022-03-10Python全栈之路正则函数
- 2022-03-10详解Python的函数与异常
精彩推荐
- ASP教程
asp 标记字符串中指定字符变色不区分大小写
今天遇到这种问题,单纯的使用replace函数不行,他会改变原有的字符串的大小写,在网上找到相关的代码,自己备份下...
- ASP教程
asp Access数据备份,还原,压缩类代码
asp Access数据备份,还原,压缩类实现代码,大家可以参考下。...
- ASP教程
asp之基于adodb.stream的文件操作类
asp之基于adodb.stream的文件操作类...
- ASP教程
asp+javascript实现404页的处理转换
asp+javascript实现404页的处理转换...
- ASP教程
ASP常用函数:getpy()
ASP常用函数:getpy()...
- ASP教程
JScript中遍历Request表单参数集合的方法
这篇文章主要介绍了JScript中遍历Request表单参数集合的方法,本文以遍历Request.QueryString集合为例给出了实现代码,需要的朋友可以参考下...
- ASP教程
ASP.NET 数据源
数据源 一个 data sourse 控件与数据绑定的控件相互作用,并隐藏了复杂的数据的联编过程。这些是提供数据给 data bound 控件的工具,并且支持如插入,删除...
- ASP教程
asp 采集实战代码
最近实在是太流行采集了,本人是不喜欢采集的,但对采集的原理我却很有兴趣进行研究,拿到了网上采集常用函数,对其进行了一番研究,并实战,结果...