static | web | Static with the increase in the number of visits to the Web site, each read from the database is the cost of efficiency, many use Access as a database will be more experience, static page add in search, will also be preferred. The popular practice on the internet is to write the data source code into the database and then read from the database to generate static surface, so that the invisible room to enlarge the database. Creating a static page directly from an existing ASP page will save you a lot of money.
The following example is the three dynamic pages that will, index.asp?id=1/index.asp?id=2/index.asp?id=3/, respectively, generate the ndex1.htm,index2.htm,index3.htm existence root directory below:
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
%>