<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<!--#include file="inc/classmenu.asp"-->
<%
Dim HtmlContent,strHtml,Page_Strings
Dim KeyWord,classid,TempListContent,ListContent
Dim SQL,Rs,ChannelID,j,CreateHtml,ChannelRootDir
Dim maxperpage, TotalNumber, TotalPageNum, CurrentPage, i, totalrec
Dim Action,moduleid,re
Dim db_ID,db_Title,db_Content,db_Datetime
Set Re = New RegExp
Re.IgnoreCase = True
Re.Global = True
CreateHtml = 1
ChannelRootDir = ""
Newasp.LoadTemplates 9999, 7, 0
LoadXsltPage("skin/search.xslt")
HtmlContent = Page_Strings(0).text
Call searchmain
Set Re = Nothing
HtmlContent = HtmlContent & Page_Strings(4).text
HtmlContent = Replace(HtmlContent,"{$InstallDir}", Newasp.InstallDir)
HtmlContent = Replace(HtmlContent, "{$ChannelID}", 0)
HtmlContent = Replace(HtmlContent,"{$PageTitle}",KeyWord)
HtmlContent = Replace(HtmlContent, "{$ChannelRootDir}", "")
HtmlContent = Replace(HtmlContent, "{$ModuleName}", "站内搜索")
HtmlContent = Replace(HtmlContent, "{$SoftIndex}", "搜索引擎")
HtmlContent = Replace(HtmlContent, "{$KeyWord}", KeyWord)
HtmlContent = Replace(HtmlContent, "{$QueryKeyWord}", "<font color=red><strong>" & keyword & "</strong></font>")
HtmlContent = ReadClassMenu(HtmlContent)
HtmlContent = ReadClassMenubar(HtmlContent)
Newasp.HTMLValue = HtmlContent
HtmlContent = Newasp.HTMLValue
Response.Write HtmlContent
CloseConn
Public Sub searchmain()
	Dim SearchMaxPageList
	Dim findword
	Dim rsClass, strNoResult
	Dim strWord, s
	keyword = Newasp.ChkQueryStr(Trim(Request("keyword")))
	keyword = Newasp.CheckInfuse(keyword,220)
	strWord = Newasp.ChkQueryStr(Trim(Request("word")))
	strWord = Newasp.CheckInfuse(strWord,220)
	s = Newasp.ChkNumeric(Request.QueryString("s"))
	classid = Newasp.ChkNumeric(Request("classid"))
	moduleid = Newasp.ChkNumeric(Request("m"))
	ChannelID = Newasp.ChkNumeric(Request("ChannelID"))
	SearchMaxPageList = 200
	If len(keyword) = 0 Then keyword = strWord
	If moduleid = 0 Then moduleid = Newasp.ChkNumeric(Request("field"))
	If keyword = "" Then
		HtmlContent = HtmlContent & Page_Strings(5).text
		Exit Sub
	End If
	If Not Newasp.CheckQuery(keyword) Then
		Call OutAlertScript("你查询的关键中有非法字符！\n请返回重新输入关键字查询。")
		Exit Sub
	End If
	'On Error Resume Next
	HtmlContent = HtmlContent & Page_Strings(1).text
	maxperpage = 20
	If Not IsNumeric(Request("page")) And Len(Request("page")) <> 0 Then
		Response.Write ("错误的系统参数!请输入整数")
		Response.End
	End If
	If Not IsEmpty(Request("page")) And Len(Request("page")) <> 0 Then
		CurrentPage = CInt(Request("page"))
	Else
		CurrentPage = 1
	End If
	If CInt(CurrentPage) = 0 Then CurrentPage = 1
	strNoResult = Re_Replace(Page_Strings(6).text, "{$KeyWord}", keyword)
	Action = Newasp.CheckStr(Trim(Request("act")))
	Action = Newasp.CheckStr(Action)
	If moduleid = 1 Then
		If LCase(Action) = "topic" Then
			findword = "(A.title like '%" & keyword & "%' Or A.Related like '%" & keyword & "%')"
		ElseIf LCase(Action) = "content" Then
			If CInt(Newasp.FullContQuery) <> 0 Then
				findword = "(A.title like '%" & keyword & "%' Or A.Related like '%" & keyword & "%' Or A.Content like '%" & keyword & "%')"
			Else
				findword = "(A.title like '%" & keyword & "%' Or A.Related like '%" & keyword & "%')"
			End If
		Else
			findword = "(A.title like '%" & keyword & "%' Or A.Related like '%" & keyword & "%')"
		End If
	Else
		If LCase(Action) = "topic" Then
			findword = "(A.SoftName like '%" & keyword & "%' Or A.SoftVer like '%" & keyword & "%' Or A.Related like '%" & keyword & "%')"
		ElseIf LCase(Action) = "content" Then
			If CInt(Newasp.FullContQuery) <> 0 Then
				findword = "(A.SoftName like '%" & keyword & "%' Or A.SoftVer like '%" & keyword & "%' Or A.Related like '%" & keyword & "%' Or A.Content like '%" & keyword & "%')"
			Else
				findword = "(A.SoftName like '%" & keyword & "%' Or A.SoftVer like '%" & keyword & "%' Or A.Related like '%" & keyword & "%')"
			End If
		Else
			findword = "(A.SoftName like '%" & keyword & "%' Or A.SoftVer like '%" & keyword & "%' Or A.Related like '%" & keyword & "%')"
		End If
	End If
	If LCase(Action) <> "isweb" Then
		If IsEmpty(Session("QueryLimited")) Then
			Session("QueryLimited") = keyword & "|" & Action & "|" & Now()
		Else
			Dim QueryLimited
			QueryLimited = Split(Session("QueryLimited"), "|")
			If UBound(QueryLimited) = 2 Then
				If CStr(Trim(QueryLimited(0))) = CStr(keyword) And CStr(Trim(QueryLimited(1))) = CStr(Action) Then
					Session("QueryLimited") = keyword & "|" & Action & "|" & Now()
				Else
					If DateDiff("s", QueryLimited(2), Now()) < 5 Then
						Dim strLimited
						strLimited = "对不起！本站限制了每次搜索时间间隔为 1 秒"
						Call OutAlertScript(Replace(Replace(strLimited, Chr(34), "\"""), vbCrLf, ""))
						Exit Sub
					Else
						Session("QueryLimited") = keyword & "|" & Action & "|" & Now()
					End If
				End If
			Else
				Session("QueryLimited") = keyword & "|" & Action & "|" & Now()
			End If
		End If
	End If
	If LCase(Action) <> "isweb" Then
	If classid > 0 Then
		Set rsClass = Newasp.Execute("SELECT ClassID,ChildStr FROM [xp90com_Classify] WHERE ChannelID=" & ChannelID & " And ClassID=" & CLng(Request("classid")))
		If rsClass.BOF And rsClass.EOF Then
			HtmlContent = HtmlContent & Page_Strings(3).text
			HtmlContent = Replace(HtmlContent, "{$ReadListPage}", strNoResult)
			HtmlContent = Replace(HtmlContent, "{$totalrec}", 0)
			HtmlContent = Replace(HtmlContent, "{$TotalPageNum}", 0)
			Set rsClass = Nothing
			Response.Write HtmlContent
			Exit Sub
		Else
			findword = "A.ClassID IN (" & rsClass("ChildStr") & ") And " & findword
		End If
		rsClass.Close: Set rsClass = Nothing
	End If
	If Not IsObject(Conn) Then ConnectionDatabase
	If moduleid = 1 Then
		If ChannelID > 0 Then
			SQL = "SELECT TOP " & SearchMaxPageList & " A.ArticleID,A.ClassID,A.ChannelID,A.BriefTopic,A.title,A.content,A.Related,A.Author,A.username,A.star,A.isBest,A.WriteTime,A.Allhits,A.HtmlFileDate,C.ClassName,C.HtmlFileDir FROM [xp90com_Article] A INNER JOIN [xp90com_Classify] C On A.ClassID=C.ClassID WHERE A.ChannelID=" & ChannelID & " And A.isAccept > 0 And " & findword & " ORDER BY A.WriteTime DESC,A.ArticleID DESC"
		Else
			SQL = "SELECT TOP " & SearchMaxPageList & " A.ArticleID,A.ClassID,A.ChannelID,A.BriefTopic,A.title,A.content,A.Related,A.Author,A.username,A.star,A.isBest,A.WriteTime,A.Allhits,A.HtmlFileDate,C.ClassName,C.HtmlFileDir FROM [xp90com_Article] A INNER JOIN [xp90com_Classify] C On A.ClassID=C.ClassID WHERE A.isAccept > 0 And " & findword & " ORDER BY A.WriteTime DESC,A.ArticleID DESC"
		End If
	Else
		If ChannelID > 0 Then
			SQL = "SELECT TOP " & SearchMaxPageList & " A.SoftID,A.ClassID,A.ChannelID,A.SoftName,A.SoftVer,A.content,A.Related,A.Languages,A.SoftType,A.RunSystem,A.impower,A.SoftSize,A.star,A.SoftTime,A.username,A.Allhits,A.HtmlFileDate,C.ClassName,C.HtmlFileDir,C.UseHtml FROM [xp90com_SoftLists] A INNER JOIN [xp90com_Classify] C On A.ClassID=C.ClassID WHERE A.ChannelID=" & ChannelID & " And A.isAccept > 0 And " & findword & " ORDER BY A.SoftTime DESC ,A.softid DESC"
		Else
			SQL = "SELECT TOP " & SearchMaxPageList & " A.SoftID,A.ClassID,A.ChannelID,A.SoftName,A.SoftVer,A.content,A.Related,A.Languages,A.SoftType,A.RunSystem,A.impower,A.SoftSize,A.star,A.SoftTime,A.username,A.Allhits,A.HtmlFileDate,C.ClassName,C.HtmlFileDir,C.UseHtml FROM [xp90com_SoftLists] A INNER JOIN [xp90com_Classify] C On A.ClassID=C.ClassID WHERE A.isAccept > 0 And " & findword & " ORDER BY A.SoftTime DESC ,A.softid DESC"
		End If
	End If
	Set Rs = CreateObject("ADODB.Recordset")
	Rs.Open SQL, Conn, 1, 1
	If Rs.BOF And Rs.EOF Then
		'如果没有找到相关内容,清除掉无用的标签代码
		HtmlContent = HtmlContent & Page_Strings(3).text
		HtmlContent = Replace(HtmlContent, "{$ReadListPage}", strNoResult)
		HtmlContent = Replace(HtmlContent, "{$totalrec}", 0)
		HtmlContent = Replace(HtmlContent, "{$TotalPageNum}", 0)
	Else
		TotalNumber = Rs.RecordCount
		If (TotalNumber Mod maxperpage) = 0 Then
			TotalPageNum = TotalNumber \ maxperpage
		Else
			TotalPageNum = TotalNumber \ maxperpage + 1
		End If
		If CurrentPage > TotalPageNum Then CurrentPage = TotalPageNum
		If CurrentPage < 1 Then CurrentPage = 1
		HtmlContent = Replace(HtmlContent, "{$totalrec}", TotalNumber)
		'获取模板标签[ShowRepetend][/ReadSoftList]中的字符串
		TempListContent = Page_Strings(2).text
		Call LoadSearchList
	End If
	Rs.Close: Set Rs = Nothing
	Else
			HtmlContent = HtmlContent & Page_Strings(3).text
			HtmlContent = Replace(HtmlContent, "{$ReadListPage}", "")
			HtmlContent = Replace(HtmlContent, "{$totalrec}", 0)
			If s = 1 Then
				Call isWeb_Query()
				Exit Sub
			End If
			HtmlContent = HtmlContent & SearchObj
			Exit Sub
	End If
End Sub
'================================================
'过程名：LoadSearchResult
'作  用：装载搜索列表
'================================================
Public Sub LoadSearchList()
	If IsNull(TempListContent) Then Exit Sub
	i = 0
	If TotalPageNum > 1 Then Rs.Move (CurrentPage - 1) * maxperpage
	ListContent = ""
	j = (CurrentPage - 1) * maxperpage + 1
	Do While Not Rs.EOF And i < CInt(maxperpage)
		If Not Response.IsClientConnected Then Response.End
		If moduleid = 1 Then
			Call  ArticleSearchResult
		Else
			Call  DownSearchResult
		End If
		Rs.MoveNext
		i = i + 1
		j = j + 1
		If i >= maxperpage Then Exit Do
	Loop
	Dim strPagination
	strPagination = showlistpage(CurrentPage, TotalPageNum, TotalNumber, maxperpage, "&amp;m=" & moduleid & "&amp;act=" & Action & "&amp;classid=" & classid & "&amp;word=" & Server.URLEncode(keyword), "搜索结果")
	HtmlContent = HtmlContent &  ListContent & Page_Strings(3).text
	HtmlContent = Replace(HtmlContent, "{$TotalPageNum}", TotalPageNum)
	HtmlContent = Replace(HtmlContent, "{$ReadListPage}", strPagination)
End Sub
Public Sub DownSearchResult()
	Dim sTitle, sTopic, softname, ListStyle, TitleWord,HtmlFileName
	Dim LinksUrl, SoftTime, sClassName, SoftImage, SoftVer,SoftIntro
	ChannelID = Rs("ChannelID")
	Newasp.LoadChannel(ChannelID)
	ChannelRootDir = Newasp.ChannelPath
	ListContent = ListContent & TempListContent
	If (i Mod 2) = 0 Then
		ListStyle = 1
	Else
		ListStyle = 2
	End If
	TitleWord = Re_Replace(Rs("SoftName") & " " & Rs("SoftVer"), "" & keyword & "", "<span style=""font-size : 15px;color: red"">" & keyword & "</span>")
	sTitle = TitleWord
	If CInt(CreateHtml) <> 0 Then
		HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("SoftID"), Newasp.ChannelHtmlExt, Newasp.ChannelPrefix, Newasp.ChannelHtmlForm, "")
		LinksUrl = ShowChannelPath(Newasp.ChannelPath, Rs("HtmlFileDir")) & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.ChannelHtmlPath) & HtmlFileName
		sClassName = ChannelRootDir & Rs("HtmlFileDir")
	Else
		LinksUrl = ChannelRootDir & "show.asp?id=" & Rs("SoftID")
		sClassName = ChannelRootDir & "list.asp?classid=" & Rs("ClassID")
	End If
	sClassName = "<a href=""" & sClassName & """ title=""" & Rs("ClassName") & """ target=""_blank"">" & Rs("ClassName") & "</a>"
	softname = "<a href='" & LinksUrl & "' title='" & Rs("SoftName") & Rs("SoftVer") & "' class=""searchtitle"" target=""_blank"">" & sTitle & "</a>"
	SoftIntro = Newasp.CutString(Rs("Content"), 150)
	SoftIntro = Re_Replace(SoftIntro, "" & keyword & "", "<span style=""font-size : 15px;color: red"">" & keyword & "</span>")
	SoftTime = Newasp.ShowDateTime(Rs("SoftTime"), 2)
	ListContent = Replace(ListContent, "{$KeyWord}", keyword)
	ListContent = Replace(ListContent, "{$totalrec}", TotalNumber)
	ListContent = Replace(ListContent, "{$ClassifyName}", sClassName)
	ListContent = Replace(ListContent, "{$Title}", softname)
	ListContent = Replace(ListContent, "{$Topic}", sTitle)
	ListContent = Replace(ListContent, "{$LinksUrl}", LinksUrl)
	ListContent = Replace(ListContent, "{$Star}", Rs("star"))
	ListContent = Replace(ListContent, "{$Hits}", Rs("AllHits"))
	ListContent = Replace(ListContent, "{$UserName}", Rs("username"))
	ListContent = Replace(ListContent, "{$DateTime}", SoftTime)
	ListContent = Replace(ListContent, "{$Content}", SoftIntro)
	ListContent = Replace(ListContent, "{$ListStyle}", ListStyle)
	ListContent = Replace(ListContent, "{$AuthorSize}", "大小：" & ReadSoftsize(Rs("SoftSize")))
	ListContent = Replace(ListContent, "{$Impower}", "授权："& Rs("impower"))
	ListContent = Replace(ListContent, "{$Language}", "语言：" & Rs("Languages"))
	ListContent = Replace(ListContent, "{$SoftType}", Rs("SoftType"))
	ListContent = Replace(ListContent, "{$ID}", Rs("SoftID"))
	ListContent = Replace(ListContent, "{$Order}", j)
	ListContent = Replace(ListContent, "{$ChannelModule}", Newasp.ChannelModule)
End Sub
Private Sub ArticleSearchResult()
	Dim sTitle, sTopic, ArticleTitle, ListStyle, TitleWord
	Dim ArticleContent, LinksUrl, WriteTime, sClassName,HtmlFileName
	ChannelID = Rs("ChannelID")
	Newasp.LoadChannel(ChannelID)
	ChannelRootDir = Newasp.ChannelPath
	ListContent = ListContent & TempListContent
	If (i Mod 2) = 0 Then
		ListStyle = 1
	Else
		ListStyle = 2
	End If
	TitleWord = Re_Replace(Rs("title"), "" & keyword & "", "<span style=""font-size : 15px;color: red"">" & keyword & "</span>")
	sTitle = TitleWord
	sTopic = Newasp.ReadPicTopic(Rs("BriefTopic"))
	If CInt(CreateHtml) <> 0 Then
		HtmlFileName = Newasp.ReadFileName(Rs("HtmlFileDate"), Rs("ArticleID"), Newasp.ChannelHtmlExt, Newasp.ChannelPrefix, Newasp.ChannelHtmlForm, "")
		LinksUrl = ShowChannelPath(Newasp.ChannelPath, Rs("HtmlFileDir")) & Newasp.ShowDatePath(Rs("HtmlFileDate"), Newasp.ChannelHtmlPath) & HtmlFileName
		sClassName = ChannelRootDir & Rs("HtmlFileDir")
	Else
		LinksUrl = ChannelRootDir & "show.asp?id=" & Rs("ArticleID")
		sClassName = ChannelRootDir & "list.asp?classid=" & Rs("ClassID")
	End If
	sClassName = "<a href='" & sClassName & "' title='" & Rs("ClassName") & "' target=""_blank"">" & Rs("ClassName") & "</a>"
	ArticleTitle = "<a href='" & LinksUrl & "' title='" & Rs("title") & "' class=showtopic target=""_blank"">" & sTitle & "</a>"
	ArticleContent = Newasp.CutString(Rs("Content"), 150)
	ArticleContent = Re_Replace(ArticleContent, "" & keyword & "", "<span style=""font-size : 15px;color: red"">" & keyword & "</span>")
	WriteTime = Newasp.ShowDateTime(Rs("WriteTime"), 2)
	ListContent = Replace(ListContent, "{$KeyWord}", keyword)
	ListContent = Replace(ListContent, "{$totalrec}", TotalNumber)
	ListContent = Replace(ListContent, "{$ClassifyName}", sClassName)
	ListContent = Replace(ListContent, "{$Title}", sTopic & ArticleTitle)
	ListContent = Replace(ListContent, "{$Topic}", sTopic & sTitle)
	ListContent = Replace(ListContent, "{$Content}", ArticleContent)
	ListContent = Replace(ListContent, "{$LinksUrl}", LinksUrl)
	ListContent = Replace(ListContent, "{$Star}", Rs("star"))
	ListContent = Replace(ListContent, "{$Hits}", Rs("AllHits"))
	ListContent = Replace(ListContent, "{$UserName}", Rs("username"))
	ListContent = Replace(ListContent, "{$DateTime}", WriteTime)
	ListContent = Replace(ListContent, "{$Content}", ArticleContent)
	ListContent = Replace(ListContent, "{$ListStyle}", ListStyle)
	ListContent = Replace(ListContent, "{$AuthorSize}", "作者：" & Newasp.ChkNull(Rs("Author")))
	ListContent = Replace(ListContent, "{$ID}", Rs("ArticleID"))
	ListContent = Replace(ListContent, "{$Order}", j)
	ListContent = Replace(ListContent, "{$ChannelModule}", Newasp.ChannelModule)
	ListContent = Replace(ListContent, "{$Impower}", "")
	ListContent = Replace(ListContent, "{$Language}", "")
	ListContent = Replace(ListContent, "{$SoftType}", "")
End Sub
'================================================
'函数名：ReadSoftsize
'作  用：读取软件的大小
'================================================
Function ReadSoftsize(ByVal para)
	On Error Resume Next
	Dim parasize
	parasize = Clng(para)
	If parasize = 0 Then
		ReadSoftsize = "未知"
		Exit Function
	End If
	If parasize > 1024*1024 Then
		ReadSoftsize = Round(parasize / (1024*1024), 2) & " GB"
		Exit Function
	ElseIf parasize > 1024 Then
		ReadSoftsize = Round(parasize / 1024, 2) & " MB"
		Exit Function
	Else
		ReadSoftsize = parasize & " KB"
		Exit Function
	End If
	ReadSoftsize = "未知"
End Function
Public Function showlistpage(page,Pcount,totalnumber,maxperpage,strLink,ListName)
	Dim strTemp, b, e
	Dim i, n, p, s
	b = 5 : e = 5 : s = "五"
	If (page - 1) Mod b = 0 Then
		p = (page-1) \ b
	Else
		p = ((page-1) - (page-1) Mod b) \ b
	End If
	If totalnumber Mod maxperpage = 0 Then
		n = totalnumber \ maxperpage
	Else
		n = (totalnumber - totalnumber Mod maxperpage) \ maxperpage + 1
	End If
	strTemp = "<table border=""0"" cellpadding=""0"" cellspacing=""1"" class=""Tableborder5"">" & vbNewLine
	strTemp = strTemp & "	<form method=""post"" action=""?pcount="& Pcount & strLink & """>" & vbNewLine
	strTemp = strTemp & "	<tr align=""center"">" & vbNewLine
	strTemp = strTemp & "		<td class=""tabletitle1"" title=""" & ListName & """>&nbsp;" & ListName & "&nbsp;</td>" & vbNewLine
	strTemp = strTemp & "		<td class=""tabletitle1"" title=""总数"">&nbsp;" & totalnumber & "&nbsp;</td>" & vbNewLine
	strTemp = strTemp & "		<td class=""tabletitle1"" title=""每页"">&nbsp;" & maxperpage & "&nbsp;</td>" & vbNewLine
	strTemp = strTemp & "		<td class=""tabletitle1"" title=""页次"">&nbsp;" & page & "/" & Pcount & "页&nbsp;</td>" & vbNewLine
	If page = 1 Then
		strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<font face=""webdings"">9</font>&nbsp;</td>" & vbNewLine
	Else
		strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<a href=""?page=1" & strLink & """ title=""首页""><font face=""webdings"">9</font></a>&nbsp;</td>" & vbNewLine
	End If
	If p * b > 0 Then
		strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<a href=""?page="& p * b & strLink & """ title=""上" & s & "页""><font face=""webdings"">7</font></a>&nbsp;</td>" & vbNewLine
	Else
		strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<font face=""webdings"">7</font>&nbsp;</td>" & vbNewLine
	End If
	For i = p * b + 1 To p * b + e
		If i = page Then
			strTemp = strTemp & "		<td class=""tablebody2"">&nbsp;<font class=""normalTextSmall""><u><b>" & i & "</b></u></font>&nbsp;</td>" & vbNewLine
		Else
			strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<a href=""?page=" & i & strLink & """ title=""第" & i & "页"">" & i & "</a>&nbsp;</td>" & vbNewLine
		End if
		If i = n Then Exit For
	Next
	If i < n Then
		strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<a href=""?page=" & i & strLink & """ title=""下" & s & "页""><font face=""webdings"">8</font></a>&nbsp;<td>" & vbNewLine
	Else
		strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<font face=""webdings"">8</font>&nbsp;<td>" & vbNewLine
	End If
	If page = n Then
		strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<Font face=""webdings"">:</font>&nbsp;</td>" & vbNewLine
	Else
		strTemp = strTemp & "		<td class=""tablebody1"">&nbsp;<a href=""?page=" & n & strLink & """ title=""尾页""><font face=""webdings"">:</font></a>&nbsp;</td>" & vbNewLine
	End If
	strTemp = strTemp & "		<td class=""tablebody1""><input class=""PageInput"" type=""text"" name=""page"" size=""1"" maxlength=""10"" value=""" & page & """></td>" & vbNewLine
	strTemp = strTemp & "		<td class=""tablebody1""><input type=""submit"" value=""Go"" name=""submit"" class=""PageInput""></td>" & vbNewLine
	strTemp = strTemp & "	</tr>" & vbNewLine
	strTemp = strTemp & "	</form>" & vbNewLine
	strTemp = strTemp & "</table>" & vbNewLine
	showlistpage = strTemp
End Function
'页面加载
Public Sub LoadXsltPage(ByVal StyleFile)
	Dim XslDoc,Page_File
	Page_File = Server.MapPath(StyleFile)
	Set XslDoc=Server.CreateObject("Msxml2.FreeThreadedDOMDocument")
	If Not XslDoc.Load(Page_File) Then
		Response.Write "模板不存在"
		Response.End
		Exit Sub
	Else
		Set Page_Strings = XslDoc.DocumentElement.selectNodes("xsl:variable")
	End If
	Set XslDoc = Nothing
End Sub
Public Function Re_Replace(str,retxt,replacetxt)
	retxt = Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(retxt, "[", "\["), "]", "\]"), "(", "\("), ")", "\)"), "$", "\$"), "^", "\^"), "{", "\{"), "}", "\}"), "+", "\+"), ".", "\.")
	Re.Pattern = retxt
	Re_Replace = Re.Replace(str,replacetxt)
End Function
%>
