⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.asp

📁 搜索动力2009(asp+access) Ver 3.2 (思亲版): 1. 新增“首页换肤”用户自定义功能 2. 新增“设置”链接 3. 新增“设置”页面 4. 新增“选择我喜欢的皮肤”用户自定义功
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="config.asp"-->
<%
	search=""&request("search")&""
	want=""&request("want")&""
	searchencode=Server.URLEncode(search)
%>
<%
Response.Expires = 0  
Response.expiresabsolute = Now() - 1  
Response.addHeader "pragma", "no-cache"  
Response.addHeader "cache-control", "private"  
Response.CacheControl = "no-cache" 
Response.Buffer = True 
Response.Clear
Server.ScriptTimeOut=999999999

Function GetPage(url) 
	Set Retrieval = CreateObject("Microsoft.XMLHTTP") 
	With Retrieval 
	.Open "Get", url, False, "", "" 
	.Send 
	GetPage = BytesToBstr(.ResponseBody)
	End With 
	Set Retrieval = Nothing 
End Function

Function BytesToBstr(body)
	dim objstream
	set objstream = Server.CreateObject("Adodb." & "Stream")
	objstream.Type = 1
	objstream.Mode =3
	objstream.Open
	objstream.Write body
	objstream.Position = 0
	objstream.Type = 2
	objstream.Charset = "UTF-8"
	BytesToBstr = objstream.ReadText 
	objstream.Close
	set objstream = nothing
End Function

Function GetContent(str,start,last,n)
	If Instr(lcase(str),lcase(start))>0 then
		select case n
		case 0	'左右都截取(都取前面)(去处关键字)
		GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
		GetContent=Left(GetContent,Instr(lcase(GetContent),lcase(last))-1)
		case 1	'左右都截取(都取前面)(保留关键字)
		GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))+1)
		GetContent=Left(GetContent,Instr(lcase(GetContent),lcase(last))+Len(last)-1)
		case 2	'只往右截取(取前面的)(去除关键字)
		GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))-Len(start)+1)
		case 3	'只往右截取(取前面的)(包含关键字)
		GetContent=Right(str,Len(str)-Instr(lcase(str),lcase(start))+1)
		case 4	'只往左截取(取后面的)(包含关键字)
		GetContent=Left(str,InstrRev(lcase(str),lcase(start))+Len(start)-1)
		case 5	'只往左截取(取后面的)(去除关键字)
		GetContent=Left(str,InstrRev(lcase(str),lcase(start))-1)
		case 6	'只往左截取(取前面的)(包含关键字)
		GetContent=Left(str,Instr(lcase(str),lcase(start))+Len(start)-1)
		case 7	'只往右截取(取后面的)(包含关键字)
		GetContent=Right(str,Len(str)-InstrRev(lcase(str),lcase(start))+1)
		case 8	'只往左截取(取前面的)(去除关键字)
		GetContent=Left(str,Instr(lcase(str),lcase(start))-1)
		case 9	'只往右截取(取后面的)(包含关键字)
		GetContent=Right(str,Len(str)-InstrRev(lcase(str),lcase(start)))
		end select
	Else
		GetContent=""
	End if
End function

Function GetPage(url) 
on error resume next 
dim oSend
set oSend=createobject("MSXML2.XMLHTTP")
oSend.open "GET",url,false 
oSend.send() 
if oSend.readystate<>4 then exit function 
GetPage = BytesToBstr(oSend.responseBody)
set oSend=nothing
if err.number<>0 then err.Clear  
End Function 
%>
<%
url="http://"&serverline&"/zxsou/m/2009_asp_search.asp?want="&want&"&webmaster="&webmaster&"&search="&searchencode&""
Html=GetPage(url)
getsearch=GetContent(Html,"<!--search top-->","<!--search bottom-->",0)
%><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><%=name%>_<%=search%></title>
<style type="text/css">
<%Server.Execute "../skin/"&skin&"/mobile.css"%>
</style>
</head>
<body>
<h1><a href="./"><%=name%></a></h1>
<h2>搜索内容:</h2>
<form method="get" action="./search.asp">
<p><input type="text" name="search" value="<%=search%>"><input type="hidden" name="want" value="<%=want%>"><input type="submit" value="搜"></p>
<%=getsearch%>
<a href="./">返回首页</a>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -