请问ASP自动生成HTML静态页面问题(如果设置保存为UTF-8)??
如下代码怎么改?Dimfso,fDimstrTitle,strContent,strOutsetf=server.createobject("adodb.recordse...
如下代码怎么改?
Dim fso,f
Dim strTitle,strContent,strOut
set f=server.createobject("adodb.recordset")
f.open "select * from template where id=2",conn,1,3
name=f("name")
html=f("html")
strOut=f("template")
sysj=month(now())&"月"&day(now())&"日"&Hour(now())&"时"&Minute(now())&"分"
Set ads=Server.CreateObject("Adodb.Recordset")
SqlT="select top 10 id,title,url,se from aspliancom_ads where weizhi=0 and time>now() order by top desc,id"
ads.open SQLT,conn,1,1
numrow2=0
menuads=menuads&"<table width=970 border=0 align=center>"
menuads=menuads&"<tr><td height=20 width=60><b>特别推荐:</b></td><td height=20>"
if ads.EOF and ads.BOF then
menuads=menuads&"<td height=20 align=center>暂时没有内容</td>"
else
numRows=0
While (Not ads.EOF)
if ads("se")=1 then
menuads=menuads&" <img src=/images/01.gif> <a class=word href="&ads("url")&" target=_blank><font color='#0000ff'>"&ads("Title")&"</font></a>"
else
if ads("se")=2 then
menuads=menuads&" <img src=/images/01.gif> <a class=word href="&ads("url")&" target=_blank><font color='#ff0000'>"&ads("Title")&"</font></a>"
else
menuads=menuads&" <img src=/images/01.gif> <a class=word href="&ads("url")&" target=_blank>"&ads("Title")&"</a>"
end if
end if
numRows=numRows+1
ads.MoveNext
if (numRows mod 10 =0) Then
numrow2=numrow2+1
menuads=menuads&"</td></tr>"
end if
Wend
end if
ads.close
Set ads = Nothing
menuads=menuads&"</table>"
strOut=Replace(strOut,"<{{menuads}}>",menuads)
。
。
Copyright=Copyright&Powered
strOut=Replace(strOut,"<{{sysj}}>",sysj)
strOut=Replace(strOut,"<{{baidu}}>",baidu)
strOut=Replace(strOut,"<{{site}}>",site)
strOut=Replace(strOut,"<{{siteurl}}>",siteurl)
strOut=Replace(strOut,"<{{email}}>",email)
strOut=Replace(strOut,"<{{Copyright}}>",Copyright)
strOut=Replace(strOut,"<{{icp}}>",icp)
strOut=Replace(strOut,"<{{qq}}>",qq)
strOut=Replace(strOut,"<{{menuads}}>",menuads)
strOut=Replace(strOut,"<{{baidu}}>",baidu)
strOut=Replace(strOut,"<{{ads01}}>",ads01)
strOut=Replace(strOut,"<{{ads02}}>",ads02)
strOut=Replace(strOut,"<{{ads03}}>",ads03)
strOut=Replace(strOut,"<{{ads04}}>",ads04)
strOut=Replace(strOut,"<{{ads05}}>",ads05)
strOut=Replace(strOut,"<{{ads06}}>",ads06)
strOut=Replace(strOut,"<{{ads07}}>",ads07)
strOut=Replace(strOut,"<{{ads08}}>",ads08)
strOut=Replace(strOut,"<{{ads09}}>",ads09)
strOut=Replace(strOut,"<{{ads10}}>",ads10)
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set f=fso.CreateTextFile(Server.MapPath("../"&html&""),true)
f.WriteLine strOut
f.close
Response.Write "<li>生成"&name&"成功</A><br>"
set f=Nothing
请高手帮我处理一下,谢谢。
set fso=Nothing 展开
Dim fso,f
Dim strTitle,strContent,strOut
set f=server.createobject("adodb.recordset")
f.open "select * from template where id=2",conn,1,3
name=f("name")
html=f("html")
strOut=f("template")
sysj=month(now())&"月"&day(now())&"日"&Hour(now())&"时"&Minute(now())&"分"
Set ads=Server.CreateObject("Adodb.Recordset")
SqlT="select top 10 id,title,url,se from aspliancom_ads where weizhi=0 and time>now() order by top desc,id"
ads.open SQLT,conn,1,1
numrow2=0
menuads=menuads&"<table width=970 border=0 align=center>"
menuads=menuads&"<tr><td height=20 width=60><b>特别推荐:</b></td><td height=20>"
if ads.EOF and ads.BOF then
menuads=menuads&"<td height=20 align=center>暂时没有内容</td>"
else
numRows=0
While (Not ads.EOF)
if ads("se")=1 then
menuads=menuads&" <img src=/images/01.gif> <a class=word href="&ads("url")&" target=_blank><font color='#0000ff'>"&ads("Title")&"</font></a>"
else
if ads("se")=2 then
menuads=menuads&" <img src=/images/01.gif> <a class=word href="&ads("url")&" target=_blank><font color='#ff0000'>"&ads("Title")&"</font></a>"
else
menuads=menuads&" <img src=/images/01.gif> <a class=word href="&ads("url")&" target=_blank>"&ads("Title")&"</a>"
end if
end if
numRows=numRows+1
ads.MoveNext
if (numRows mod 10 =0) Then
numrow2=numrow2+1
menuads=menuads&"</td></tr>"
end if
Wend
end if
ads.close
Set ads = Nothing
menuads=menuads&"</table>"
strOut=Replace(strOut,"<{{menuads}}>",menuads)
。
。
Copyright=Copyright&Powered
strOut=Replace(strOut,"<{{sysj}}>",sysj)
strOut=Replace(strOut,"<{{baidu}}>",baidu)
strOut=Replace(strOut,"<{{site}}>",site)
strOut=Replace(strOut,"<{{siteurl}}>",siteurl)
strOut=Replace(strOut,"<{{email}}>",email)
strOut=Replace(strOut,"<{{Copyright}}>",Copyright)
strOut=Replace(strOut,"<{{icp}}>",icp)
strOut=Replace(strOut,"<{{qq}}>",qq)
strOut=Replace(strOut,"<{{menuads}}>",menuads)
strOut=Replace(strOut,"<{{baidu}}>",baidu)
strOut=Replace(strOut,"<{{ads01}}>",ads01)
strOut=Replace(strOut,"<{{ads02}}>",ads02)
strOut=Replace(strOut,"<{{ads03}}>",ads03)
strOut=Replace(strOut,"<{{ads04}}>",ads04)
strOut=Replace(strOut,"<{{ads05}}>",ads05)
strOut=Replace(strOut,"<{{ads06}}>",ads06)
strOut=Replace(strOut,"<{{ads07}}>",ads07)
strOut=Replace(strOut,"<{{ads08}}>",ads08)
strOut=Replace(strOut,"<{{ads09}}>",ads09)
strOut=Replace(strOut,"<{{ads10}}>",ads10)
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set f=fso.CreateTextFile(Server.MapPath("../"&html&""),true)
f.WriteLine strOut
f.close
Response.Write "<li>生成"&name&"成功</A><br>"
set f=Nothing
请高手帮我处理一下,谢谢。
set fso=Nothing 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询