Generating static pages from existing ASP pages will save a lot.
In the following example, www.111cn.net/index.asp? Id = 1/index. asp? Id = 2/index. asp? Id = 3/these three dynamic pages do not generate ndex1.htm,index2.htm,index3.htm exists in the root directory:
Code:
<%
Dim strUrl, Item_Classid, id, FileName, FilePath, Do_Url, Html_Temp
Html_Temp = "<UL>"
For I = 1 To 3
Html_Temp = Html_Temp & "<LI>"
Item_Classid = I
FileName = "Index" & Item_Classid & ". htm"
FilePath = Server. MapPath ("/") & "\" & FileName
Html_Temp = Html_Temp & FilePath & "</LI>"
Do_Url = "http ://"
Do_Url = Do_Url & Request. ServerVariables ("SERVER_NAME") & "/main/index. asp"
Do_Url = Do_Url &"? Item_Classid = "& Item_Classid
StrUrl = Do_Url
Dim objXmlHttp
Set objXmlHttp = Server. CreateObject ("Microsoft. XMLHTTP ")
ObjXmlHttp. open "GET", strUrl, false
ObjXmlHttp. send ()
Dim binFileData
BinFileData = objXmlHttp. responseBody
Dim objAdoStream
Set objAdoStream = Server. CreateObject ("ADODB. Stream ")
ObjAdoStream. Type = 1
ObjAdoStream. Open ()
ObjAdoStream. Write (binFileData)
ObjAdoStream. SaveToFile FilePath, 2
ObjAdoStream. Close ()
Next
Html_Temp = Html_Temp & "<UL>"
%>
<%
Response. Write ("successfully generated File :")
Response. Write ("<BR> ")
Response. Write Html_Temp
%>
At last, this method is stupid. You can customize the template to generate it again, which can reduce the burden on the server.