[摘要]//ROOT1.嘿嘿!!!//以下代码因为是直接在本人主页上COPY下来的,已经和页面结合,所以比较难看懂.因为这个文件我是比较久以前写的..现在搞到自己也看得不大懂了~~呵呵!!!因为最近准备把电...
//ROOT1.嘿嘿!!!//
以下代码因为是直接在本人主页上COPY下来的,已经和页面结合,所以比较难看懂.因为这个文件我是比较久以前写的..现在搞到自己也看得不大懂了~~呵呵!!!因为最近准备把电脑给暂时戒了,好好学习.所以把本人写过的一些自己认为过得去的代码贴出来...呵呵
---------迟点有时间我再把处理SQL 语句得ASP文件COPY上来--------
---------根据网友输入的搜索条件动态生成SQL 语句的VBS文件-----
Sub Show(numbers)
Dim Str
Select Case numbers
Case 1
Str="∷启动按作者搜索∷"
window.document.all("show").innerHTML=Str
Case 2
Str="∷启动按单词搜索∷"
window.document.all("show").innerHTML=Str
Case 3
Str="∷启动按词组搜索∷"
window.document.all("show").innerHTML=Str
Case 4
Str="∷启动按逻辑搜索∷"
window.document.all("show").innerHTML=Str
Case 5
Str="∷按复合逻辑搜索∷"
window.document.all("show").innerHTML=Str
End Select
End Sub
'----------------------------------------------全局变量
Dim a7
a7=" "
'-------------------------------------------------------
Function checkhaha(haha)
text=replace(trim(haha.search.value),"'","''")
If text="" Then
alert("Sorry.请输入你的搜索关键字")
haha.search.value=""
haha.search.focus()
Exit Function
End if
haha.search.value=text
haha.SearchString.value=GetText(text,haha)
haha.submit()
End Function
Function GetText(text,haha)
Dim reg
Dim res
Dim sky
If haha.radiobutton.checked Then '*************************************如果按作者则提交推出
Call Show(1)
GetText="name='" & text &"'"
Exit Function
End if
'*********************************************************************
Set reg=new regexp
reg.IgnoreCase = true
reg.Global = True
reg.Pattern="\s"
res=reg.test(text)
'*********************************************************如果关键字不包含空格就进行单词搜索
If Not res Then
Call Show(2)
GetText="(标题+文章) like '%" & text & "%'"
Exit Function
End if
'********************************************************************************************
reg.Pattern="\sand
关键词:暑期缤纷巨献之~------完成支持逻辑搜索/单词搜索/词组搜索+支持OR/AND关键字! (2)