ASP生成HTML求救,无法成生文件扩展名,可以用记事本打开,生成的代码完全正常
<%@language=vbscriptcodepage=936%><%Server.ScriptTimeOut=999999%><!--#includefile="co...
<%@language=vbscript codepage=936 %>
<%Server.ScriptTimeOut=999999%>
<!--#include file="conn.asp"-->
<!--#include file="top.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/pic_class.asp"-->
<%
'CheckAdmin1
dim TagFlag,HtmlArticleId,HtmlSpecialId,HtmlNClassId,pagename,id,id1,id2,bakeurl,MaxPageline
TagFlag=request.querystring("TagFlag")
HtmlArticleId=Cint(Request.querystring("Id"))
HtmlSpecialId=Cint(Request.querystring("SpecialId"))
HtmlNClassId=Cint(Request.querystring("NClassId"))
MaxPageline=25'分页线
dim webml,html
webml="../"
html = html
if htmlml="" then
htmlml=webml
else
htmlml=""&webml&htmlml&"/"
dim folderPath
set fso=server.CreateObject(BK_FSOStr)
folderPath = server.MapPath(htmlml)
if not fso.FolderExists(folderPath) then
fso.CreateFolder(folderPath)
end if
set fso=nothing
end if
ShowCreateWindow "请稍后......"
Set XmlRs=server.CreateObject("adodb.recordset")
Select Case TagFlag
Case ""
Case "IndexHtml"
GetBookindex HtmlSpecialId,0
Case "NCIndexHtml"
GetBookindex HtmlNClassId,1
End Select
Set XmlRs=nothing
Conn.Close:Set Conn = Nothing
Sub GetBookindex(Id,Htmlflag)'生成作品首页过程
'========================================
'Htmlflag参数:
'0:生成单个作品首页html
'1:生成指定作者所有作品首页章页html
'========================================
dim SelectBookValue
Id = Cint(Id)
Select Case Htmlflag
Case "1"
SelectBookValue = "select * from Special Where NclassId="&Id&" Order By SpecialId"
Case "0"
SelectBookValue = "select * from Special Where SpecialId="&Id
End Select
Set fso=server.CreateObject(BK_FSOStr)
folderPath = server.MapPath(""&htmlml&"html")
if not fso.FolderExists(folderPath) then
fso.CreateFolder(folderPath)
end if
set fso=nothing
outstr = loadtemplate("book_index.html")
Pagetitle = "{$页面标签$}"
outstr = ReplaceHtmlTag(outstr)
XmlRs.open SelectBookValue,conn,1,1
if XmlRs.bof and XmlRs.eof then
RefreshHtml " ",0,1
RefreshHtml2 "txt1","<font color=#ff0033>当前该作者下未发布任何作品!</font>"
response.end
XmlRs.Close
Else
htmli=0
BookName = XmlRs("name")
do while not XmlRs.eof
htmli=htmli+1
Dim BooknumPath,BookSmaillPath,Thepagepaht,BookName
BooknumPath = XmlRs("SpecialId")
ScanFSOPath(""&htmlml&"html/"&BooknumPath)
BookSmaillPath = ""&htmlml&"html/"&BooknumPath
Thepagepaht="<A href="&BK_URL&">首 页</A> > <A href="&BK_URL&"class/"&XmlRs("SclassID")&".html>"&XmlRs("Sclass")&"</A> > <a href="&BK_URL&"author/"&XmlRs("NClassID")&".html>"&XmlRs("NClass")&"</a>"
If GetBookRolls(BooknumPath) >0 Then
Bookxz= "章回体,共"&GetBookRolls(BooknumPath)&"章(回)"
ElseIf GetSmallRolls(BooknumPath) >0 Then
Bookxz="文集,共"&GetSmallRolls(BooknumPath)&"篇文章"
End If
字数超限了,下面补充上来
outstr1 = Replace(outstr,"{$页面标签$}","《"&BookName&"》目录列表")
outstr1 = Replace(outstr1,"{$作品名称$}",BookName)
outstr1 = Replace(outstr1,"{$当前位置$}",Thepagepaht)
outstr1 = Replace(outstr1,"{$作品图片$}",BK_URL&XmlRs("pic"))
outstr1 = Replace(outstr1,"{$作品性质$}",Bookxz)
outstr1 = Replace(outstr1,"{$发行年份$}",XmlRs("Times"))
outstr1 = Replace(outstr1,"{$出版公司$}",XmlRs("Gongsi"))
outstr1 = Replace(outstr1,"{$作品简介$}",XmlRs("Intro"))
outstr1 = Replace(outstr1,"{$作品导读$}",GetBookhead(BooknumPath))
outstr1 = Replace(outstr1,"{$作家简介$}",GetAuthormsg(XmlRs("NClassID")))
(因为字数限制,略几行)
outstr1 = Replace(outstr1,"{$推荐作品$}",GetTopbooks())
FileName = ""&BookSmaillPath&"/Index."&html
MakeHtmlCode outstr1,FileName
RefreshHtml "√文件("&FileName&")生成完成!",htmli,XmlRs.recordcount
XmlRs.movenext
loop
End If
XmlRs.close
End Sub 展开
<%Server.ScriptTimeOut=999999%>
<!--#include file="conn.asp"-->
<!--#include file="top.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/pic_class.asp"-->
<%
'CheckAdmin1
dim TagFlag,HtmlArticleId,HtmlSpecialId,HtmlNClassId,pagename,id,id1,id2,bakeurl,MaxPageline
TagFlag=request.querystring("TagFlag")
HtmlArticleId=Cint(Request.querystring("Id"))
HtmlSpecialId=Cint(Request.querystring("SpecialId"))
HtmlNClassId=Cint(Request.querystring("NClassId"))
MaxPageline=25'分页线
dim webml,html
webml="../"
html = html
if htmlml="" then
htmlml=webml
else
htmlml=""&webml&htmlml&"/"
dim folderPath
set fso=server.CreateObject(BK_FSOStr)
folderPath = server.MapPath(htmlml)
if not fso.FolderExists(folderPath) then
fso.CreateFolder(folderPath)
end if
set fso=nothing
end if
ShowCreateWindow "请稍后......"
Set XmlRs=server.CreateObject("adodb.recordset")
Select Case TagFlag
Case ""
Case "IndexHtml"
GetBookindex HtmlSpecialId,0
Case "NCIndexHtml"
GetBookindex HtmlNClassId,1
End Select
Set XmlRs=nothing
Conn.Close:Set Conn = Nothing
Sub GetBookindex(Id,Htmlflag)'生成作品首页过程
'========================================
'Htmlflag参数:
'0:生成单个作品首页html
'1:生成指定作者所有作品首页章页html
'========================================
dim SelectBookValue
Id = Cint(Id)
Select Case Htmlflag
Case "1"
SelectBookValue = "select * from Special Where NclassId="&Id&" Order By SpecialId"
Case "0"
SelectBookValue = "select * from Special Where SpecialId="&Id
End Select
Set fso=server.CreateObject(BK_FSOStr)
folderPath = server.MapPath(""&htmlml&"html")
if not fso.FolderExists(folderPath) then
fso.CreateFolder(folderPath)
end if
set fso=nothing
outstr = loadtemplate("book_index.html")
Pagetitle = "{$页面标签$}"
outstr = ReplaceHtmlTag(outstr)
XmlRs.open SelectBookValue,conn,1,1
if XmlRs.bof and XmlRs.eof then
RefreshHtml " ",0,1
RefreshHtml2 "txt1","<font color=#ff0033>当前该作者下未发布任何作品!</font>"
response.end
XmlRs.Close
Else
htmli=0
BookName = XmlRs("name")
do while not XmlRs.eof
htmli=htmli+1
Dim BooknumPath,BookSmaillPath,Thepagepaht,BookName
BooknumPath = XmlRs("SpecialId")
ScanFSOPath(""&htmlml&"html/"&BooknumPath)
BookSmaillPath = ""&htmlml&"html/"&BooknumPath
Thepagepaht="<A href="&BK_URL&">首 页</A> > <A href="&BK_URL&"class/"&XmlRs("SclassID")&".html>"&XmlRs("Sclass")&"</A> > <a href="&BK_URL&"author/"&XmlRs("NClassID")&".html>"&XmlRs("NClass")&"</a>"
If GetBookRolls(BooknumPath) >0 Then
Bookxz= "章回体,共"&GetBookRolls(BooknumPath)&"章(回)"
ElseIf GetSmallRolls(BooknumPath) >0 Then
Bookxz="文集,共"&GetSmallRolls(BooknumPath)&"篇文章"
End If
字数超限了,下面补充上来
outstr1 = Replace(outstr,"{$页面标签$}","《"&BookName&"》目录列表")
outstr1 = Replace(outstr1,"{$作品名称$}",BookName)
outstr1 = Replace(outstr1,"{$当前位置$}",Thepagepaht)
outstr1 = Replace(outstr1,"{$作品图片$}",BK_URL&XmlRs("pic"))
outstr1 = Replace(outstr1,"{$作品性质$}",Bookxz)
outstr1 = Replace(outstr1,"{$发行年份$}",XmlRs("Times"))
outstr1 = Replace(outstr1,"{$出版公司$}",XmlRs("Gongsi"))
outstr1 = Replace(outstr1,"{$作品简介$}",XmlRs("Intro"))
outstr1 = Replace(outstr1,"{$作品导读$}",GetBookhead(BooknumPath))
outstr1 = Replace(outstr1,"{$作家简介$}",GetAuthormsg(XmlRs("NClassID")))
(因为字数限制,略几行)
outstr1 = Replace(outstr1,"{$推荐作品$}",GetTopbooks())
FileName = ""&BookSmaillPath&"/Index."&html
MakeHtmlCode outstr1,FileName
RefreshHtml "√文件("&FileName&")生成完成!",htmli,XmlRs.recordcount
XmlRs.movenext
loop
End If
XmlRs.close
End Sub 展开
展开全部
常量没有正确定义所致错误:
1、请看这里:
MaxPageline=25'分页线
dim webml,html
webml="../"
html = html
if htmlml="" then
htmlml=webml
你声明了html,但是赋值是html=html,而前面没有赋值,那么它就是个空值。
再看这里:
FileName = ""&BookSmaillPath&"/Index."&html
这个HTML文件名就应该是这样的:a/b/index.,所有没有扩展名了。
1、请看这里:
MaxPageline=25'分页线
dim webml,html
webml="../"
html = html
if htmlml="" then
htmlml=webml
你声明了html,但是赋值是html=html,而前面没有赋值,那么它就是个空值。
再看这里:
FileName = ""&BookSmaillPath&"/Index."&html
这个HTML文件名就应该是这样的:a/b/index.,所有没有扩展名了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询