下面的例子是将、index.asp?id=1/index.asp?id=2/index.asp?id=3/这三个动态页面,分别生成ndex1.htm,index2.htm,index3.htm存在根目录下面:
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 ( "成功生成文件:" ) response.write ( "<br>" ) response.write html_temp %> |
文章整理:站长天空 网址:http://www.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!




