问题是这样的,在执行以下这段代码生成HTML文件的时候,如果不添加下面代码中红色标出部分的话,程序能够正常执行,因为那里要显示多条信息,所以需要加入LOOP这个参数,但是我不明白的是,加了这个参数后,程序出现了一个非常严重的问题,就是在执行本代码的时候,就不能够完全正常执行,系统CPU资源一直都是100%。我程序是错在什么地方了,怎么修改,谢谢!
请各位大大一定要帮我!在线等待中... ...
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>生成产品所有内容页</title>
</head>
<body>
<!--#include file="../../../conn/conn.asp"-->
<!--#include file="../../../inc/safe.asp"-->
<%
'读取模板
set rs=server.createobject("adodb.recordset")
rs.open ("select productshow_type from worldec_Temp"),conn,1,1
pencat=rs("productshow_type")
rs.close
'读取要生成的条数
if request("page")<>"" then
if cint(request("page"))<1 then
currentPage=1
else
currentPage=cint(request("page"))
end if
else
currentPage=1
end if
if request("TopNew")>"" then
if Chkrequest(request("TopNew")) then
TopNew=request("TopNew")
elsewo
Response.Redirect ("/login/chklogin.asp?login=4")
end if
end if
'************** 读取条数 ***************
MaxPerPage=1
if request("all")="all" then
set rs=server.createobject("adodb.recordset")
rs.open ("select * from kjinfo order by date_time asc"),conn,1,1
end if
if not rs.eof then
rs.pagesize=MaxPerPage
mpage=rs.pagecount '得到总条数
if TopNew>"" then
currentPage=mpage-TopNew
end if
rs.move (currentPage-1)*MaxPerPage
if mpage>=currentPage then
typeid=rs("typeid")
ttid=rs("id")
sortid=rs("sortid")
showname=rs("kj_name")
kj_pingtai=rs("kj_pingtai")
kj_type=rs("kj_type")
kj_moshi=rs("kj_moshi")
end if
end if
rs.close
sorttype="select class_2.*,class_1.* from class_2,class_1 where class_2.typeid="&typeid&" and class_1.sortid=class_2.sortid"
set rssorttype=conn.execute(sorttype)
L_SORT=L_SORT&"<a href='/tradeinfo/trade/"&rssorttype("sortid")&".html'>"&rssorttype("sort")&"</a>"
L_SORT=L_SORT&" <small>></small> "
L_TYPE=L_TYPE&"<a href='/list_show_gn.asp?typeid="&typeid&"'>"&rssorttype("typename")&"</a>"
rssorttype.close
set rs=server.createobject("adodb.recordset")
rs.open ("select kjinfo.* from kjinfo where kjinfo.id="&ttid&" and kjinfo.kj_name="&showname&""),conn,1,1
company=rs("company")
'标志此条信息为已经生存HTML
conn.execute("update productshow set html_pass=1 where id="&ttid&"")
KJ_NAME=KJ_NAME&""&showname&""&VbCrLf
KJ_COPY=KJ_COPY&""&rs("kj_copy")&""&VbCrLf
if rs("kj_img")<>"nopicture.gif" then
TR_PIC=TR_PIC&"<IMG src="&rs("kj_img")&" border=0>" &VbCrLf
else
TR_PIC=TR_PIC&"<FONT class=C color=#cecfce>无控件截图</FONT>" &VbCrLf
end if
c="select * from gsjbxx where gsid="&company&""
set rsc=conn.execute(c)
TR_CORNAME=TR_COPNAME&"<A href=http://"&rsc("gsdz")&" target=_blank title="&rsc("gsmc")&">"&rsc("gsmc")&"</A>" &VbCrLf
c.close
set rsc=nothing
if rs("kj_type")<>"" then
iii=split(rs("kj_type"),",")
for i=0 to ubound(iii)
t="select * from kjtype where lxid="&iii(i)&""
set rst=conn.execute(t)
TR_LIANXI=TR_LIANXI&"<A href=/list_show_lx.asp?kj_type="&rst("lxid")&">"&rst("lxmc")&"</A>"&VbCrLf
if ubound(iii)>i then
TR_LIANXI=TR_LIANXI&" | "&VbCrLf
end if
t.close
set rsc=nothing
next
end if
if rs("kj_moshi")<>"" then
ii=split(rs("kj_moshi"),",")
for i=0 to ubound(ii)
m="select * from kjmoshi where kjmsid="&ii(i)&""
set rsm=conn.execute(m)
TR_MOSHI=TR_MOSHI&"<A href=/list_show_ms.asp?kj_moshi="&rsm("kjmsid")&">"&rsm("kjmsmc")&"</A>"&VbCrLf
if ubound(ii)>i then
TR_MOSHI=TR_MOSHI&" | "&VbCrLf
end if
m.close
set rsc=nothing
next
end if
if rs("kj_pingtai")<>"" then
pii=split(rs("kj_pingtai"),",")
for i=0 to ubound(pii)
p="select * from kjpt where ptid="&pii(i)&""
set rsp=conn.execute(p)
TR_PT=TR_PT&"<A href=/list_show_pt.asp?kj_pingtai="&rsp("ptid")&">"&rsp("ptmc")&"</A>"&VbCrLf
if ubound(pii)>i then
TR_PT=TR_PT&" | "&VbCrLf
end if
p.close
set rsc=nothing
next
end if
NL_P=NL_P&"<A class=a5 href=/info/products/"&sortid&"-"&typeid&"-"&ttid&".html>产品介绍</A>"&VbCrLf
NL_J=NL_J&"<A class=a5 href=/info/price/"&sortid&"-"&typeid&"-"&ttid&".html>产品价格</A>"&VbCrLf
NL_D=NL_D&"<A class=a5 href=/info/updata/"&sortid&"-"&typeid&"-"&ttid&".html>产品更新</A>"&VbCrLf
NL_Z=NL_Z&"<A class=a5 href=/service.asp>技术支持</A>"&VbCrLf
L_BODY=L_BODY&"<table width=90% border=0 align=center cellpadding=0 cellspacing=0>"&VbCrLf
L_BODY=L_BODY&"<tr><td>"&VbCrLf
set rsxz=server.createobject("adodb.recordset")
sqlxz="select * from kjdown where kj_id="&ttid&""
rsxz.open sqlxz,conn,1,3
do while not rsxz.eof
L_BODY=L_BODY&"<tr>"&VbCrLf
L_BODY=L_BODY&"<td height=25 >"&VbCrLf
L_BODY=L_BODY&"<a href=../downsoft.asp?xzid="&rsxz("xz_id")&">"&rsxz("xz_mc")&"</a>"&VbCrLf
L_BODY=L_BODY&"</td>"&VbCrLf
L_BODY=L_BODY&"<td height=25 >"&VbCrLf
L_BODY=L_BODY&"已下载"&rsxz("xz_cs")&"次"&VbCrLf
L_BODY=L_BODY&"</td>"&VbCrLf
L_BODY=L_BODY&"</tr>"&VbCrLf
rsxz.movenext
loop
L_BODY=L_BODY&"</table>"&VbCrLf
rs.close
response.write "<br><b>已生成/要生成的页面条数:<font color=#FF0000>"¤tPage-1&"</font>/<font color=#FF0000><b>"&mpage&"</b></font>个"
if mpage<currentPage then
response.write ",完成时间"&Now()&"</b> "
else
'************** 生成HTML页 开始 ***************
L_WORLDECNEME=L_WORLDNEME&""&webname&"" '网站名称
L_WORLDECURL=L_WORLDECURL&""&weburl&"" '网址
L_TRADEINFO=L_TRADEINFO&""&showname&"" '页面标题
L_TRADINFOID=TRADINFOID&""&ttid&"" '当前页面ID
L_TRADESEAR=L_TRADESEAR&""&search&"" '搜索关键字
L_SYSTEMTEL=L_SYSTEMTEL&""&Systemtel&"" '服务热线
pencat=replace(pencat,"L_WORLDECNEME",L_WORLDECNEME)
pencat=replace(pencat,"L_WORLDECURL",L_WORLDECURL)
pencat=replace(pencat,"L_SYSTEMTEL",L_SYSTEMTEL)
pencat=replace(pencat,"L_TRADEINFO",L_TRADEINFO)
pencat=replace(pencat,"L_TRADINFOID",L_TRADINFOID)
pencat=replace(pencat,"L_TRADESEAR",L_TRADESEAR)
pencat=replace(pencat,"L_BODY",L_BODY)
pencat=replace(pencat,"TR_PT",TR_PT)
pencat=replace(pencat,"TR_MOSHI",TR_MOSHI)
pencat=replace(pencat,"TR_LIANXI",TR_LIANXI)
pencat=replace(pencat,"TR_CORNAME",TR_CORNAME)
pencat=replace(pencat,"TR_PIC",TR_PIC)
pencat=replace(pencat,"KJ_NAME",KJ_NAME)
pencat=replace(pencat,"L_SORT",L_SORT)
pencat=replace(pencat,"L_TYPE",L_TYPE)
pencat=replace(pencat,"KJ_COPY",KJ_COPY)
pencat=replace(pencat,"NL_Z",NL_Z)
pencat=replace(pencat,"NL_P",NL_P)
pencat=replace(pencat,"NL_J",NL_J)
pencat=replace(pencat,"NL_D",NL_D)
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set sort_save = fso.CreateTextFile(server.mappath("/info/updown/"&sortid&"-"&typeid&"-"&ttid&".html"))
sort_save.Write pencat
sort_save.close
response.write "<meta http-equiv=Refresh content='0; URL=makedupdown.asp?all="&request("all")&"&full="&request("full")&"&page="¤tPage+1&"'>"
end if
'************** 生成HTML页 结束 ***************
set rs=nothing
conn.close
set conn=nothing
%>