?? search.asp
字號:
?<%
Response.ContentType ="application/vnd.wap.xhtml+xml"
%>
<?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>
<meta http-equiv="Cache-Control" content="max-age=0"/>
<meta http-equiv="Cache-control" content="no-cache" />
</head>
<body>
<p>
<%
Set Conn=Server.CreateObject("Adodb.Connection")
DBPath = Server.MapPath("#WapZJ.mdb")
Conn.Open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
'接收中文字符。
Dim KeyWord
KeyWord=Request("KeyWord")
Dim SQL,Rs
'注意下邊的這句sql語句。有時候變量要用'引起來。
SQL = "SELECT * FROM WAPZJ WHERE Title Like '%" & KeyWord & "%'" &" Or Content Like '%" & KeyWord & "%'"
Set Rs = Server.CreateObject("ADODB.RecordSet")
Rs.Open SQL,Conn,1,3
If Rs.EOF then
'對于使用Response.Write輸出的語句好像必須要進行UTF-8轉(zhuǎn)碼,雖然聲明了使用gb2312。
Response.Write Uni("沒有結(jié)果")
Response.Write "<do type='accept' label='Retry'>"
Response.Write " <go href='index.asp'/>"
Response.Write "</do>"
Else
Response.Write "標題:" & Uni(Rs("Title")) & "<br/>"
Response.Write "內(nèi)容:" & Uni(Rs("Content"))
End If
%>
<br/>
<a title="確定" href="index.asp">重新搜索</a>
</p>
</body>
</html>
<%
Rs.Close
Set Rs=Nothing
Conn.Close
Set Conn = Nothing
%>
<%
'以下是UTF-8轉(zhuǎn)碼的函數(shù)
Function Uni(Chinese)
For I = 1 to Len (Chinese)
A=Mid(Chinese, i, 1)
Uni=uni & "&#x" & Hex(Ascw(a)) & ";"
Next
End Function
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -