帮你打造属于自己的搜索引擎---百度篇(3)
<td width=1 bgcolor=#999999>
<td nowrap style="FONT-WEIGHT:bold;COLOR:#ffffff;BACKGROUND-COLOR:#0033cc" width=64>互联网</td>
<td align=right bgcolor=#eeeeee><nobr>找到符合<b><%=wd%></b>的相关网页<b><%=strPageSum_bd%></b>篇,用时<b><%=strQtime_bd%></b>秒</nobr> </td>
</tr>
<tr><td bgcolor=#999999 colspan=3 height=2></td></tr></table>
</td>
</tr>
</table>
<%
if wd="" then
Response.Write "<p align='center' ><font size=-1> 您好,请在搜索框中输入关键词.</font></p>"
elseif bNoResult_bd=1 then
Response.Write "<p align='center' ><font size=-1> 抱歉,未找到任何符合您查询条件的信息,请重新选择合适的关键词进行查询.</font></p>"
else
%>
<table width="98%" align="center" cellspacing="0" cellpadding="0" border="0">
<tr>
<td style=line-height:160% bgcolor="#ffffff" width="75%" valign=top><br>
<%=strinfo%>
</td>
<td width="25%" valign=top><br> 这是你发挥的空间!
</td>
</tr>
</table>
<table width="98%" align="center" cellspacing="0" cellpadding="4" border="0">
<tr>
<td align="center">
<br><font size=3><%=strPage%></font>
</td>
</tr>
</table>
<%End If
set strinfo=nothing
%>
<hr size="1" width="760" color="#0000ff">
<div align="center"><font size=-1>
程序更新请到这里<span class="cred">(知识分享论坛)</span>查看</font>
</div>
</BODY>
</HTML>
<%
'采集函数
Function getHTTPPage(url)
On Error Resume Next
dim http
set http=Server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
If Err.number<>0 then
Response.Write "<div align='center'><b>服务器获取文件内容出错</b></div>"
Err.Clear
End If
End function
'字节流转换为字符串
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.createObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
内容版权声明:除非注明,否则皆为本站原创文章。