这段asp文件转html代码在执行的时候经常会卡死?麻烦各位帮我看看



<!--#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"  />&nbsp;共:<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

%>



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值