<!--#include file="checklogin.asp" -->
<!--#include file="conn.asp" -->
<!--显示生成进度条-->
<script>
function fs(s,cs)
{
document.getElementById("contents").style.width=s+'%'
document.getElementById("titles").value=s+"%"
document.getElementById("counts").value=cs
}
</script>
<body>生成进度:<span ><input type="text" name="titles" id="titles" value="" style="width:50px; border:0px;font-weight:bold; color:#006600" /> 共:<input type="text" name="counts" id="counts" value="" style="width:30px; border:0px; text-align:center; font-weight:bold; color:#006633" />个文件</span>
<div id="contents" style="height:20px; border:1px solid #FF0000; background-color:#009933"></div>
</body>
<%
'================================
'====读取数据库记录
'====清水阁www.qingshuige.cn
'================================
dim mpage,i,rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * FROM news where id >=1301 and id <=1400 "
rs.open sql,conn,1,3
mpage=rs.recordcount
i=1
do while not rs.eof
'调用生成静态页面函数
call makeindex("/news_view_"&rs("id")&".html","/news_view.asp?id="&rs("id"))
rs.movenext
i=i+1
Response.Flush
Response.Clear
x=int(i*100/mpage)
response.Write("<script>fs("&x&","&mpage&")</script>")
loop
'结束
Response.Write("------共生成了"&rs.recordcount&"个文件------")
function makeindex(FileNameA,FileNameB)
FilePath = Server.MapPath("/")&"\"&FileNameA
strUrl = "http://"&Request.ServerVariables("SERVER_NAME")&"/"&FileNameB
'创建objXmlHttp
dim objXmlHttp
set objXmlHttp = Server.CreateObject("Micro"&"soft"&".XML"&"HT"&"TP")'加"&"加"&"防止误杀
objXmlHttp.open "GET",strUrl,false
objXmlHttp.send()
Dim binFileData
binFileData = objXmlHttp.responseBody
'创建objAdoStream
Dim objAdoStream
set objAdoStream = Server.CreateObject("AD"&"ODB"&".Str"&"eam")'加"&"防止误杀
objAdoStream.Type = 1
objAdoStream.Open()
objAdoStream.Write(binFileData)
objAdoStream.SaveToFile FilePath,2
objAdoStream.Close()
end function
%>
这段asp文件转html代码在执行的时候经常会卡死?麻烦各位帮我看看
最新推荐文章于 2021-06-19 06:40:40 发布