生成静态html时出现错误“类型不匹配”

问题描述

<!--#includefile="../inc/const.asp"--><!--#includefile="inc/char.asp"--><!--#includefile="../Template.Asp"--><!--#includefile="../inc/ubbcode.asp"--><%Server.ScriptTimeout=9999%><html><head><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"><title><%=site_info(0)%></title><linkhref="xfok.css"type="text/css"rel="stylesheet"><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"></head><bodytext=#000000leftmargin=0topmargin=0marginheight="0"marginwidth="0"bgcolor="#E5E5E5"><br><%DimAction,Title,ContentIfNotCheckAdmin(ScriptName)ThenstrMsg="<Li>您没有管理本页面的权限。"CallMsg()ElseSelectCaseRequest("Action")Case"ArticleBatchDel"CallArticleBatchDel()Case"ArticleBatchMove"CallArticleBatchMove()Case"ArticleBatchCheck"CallArticleBatchCheck()Case"ArticleHtml"CallArticleHtml()Case""Response.RedirectUrlEndSelectEndIfSubArticleBatchDel()DimArticleID,arrArticleID,Mode,Rs2,Sql2,c_filepath,i,fso,foutArticleID=Request.Form("ArticleId")Mode=Request.Form("Mode")IfArticleID=""ThenResponse.RedirectUrlarrArticleID=Split(ArticleID,",")Fori=0toUBound(arrArticleID)IfMode="Check"ThenSql="DeleteFROM"&TableArticleNoCheck&"WhereID="&arrArticleID(i)ElseSql="DeleteFROM"&TableArticle&"WhereID="&arrArticleID(i)SetRs2=Server.CreateObject("ADODB.Recordset")Sql2="Selectc_filepathFrom"&TableArticle&"WhereID="&arrArticleID(i)Rs2.OpenSql2,Conn,1,1c_filepath=Rs2("c_filepath")Rs2.CloseSetRs2=NothingIfc_filepath<>""ThenSetfso=Server.CreateObject("Scripting.FileSystemObject")c_filepath=Server.MapPath(c_filepath)Iffso.FileExists(c_filepath)Thenfso.DeleteFile(c_filepath)Response.Writec_filepathEndIfSetfso=NothingEndIfEndIfConn.ExecuteSqlIfMode=""Then'删除相关评论Conn.Execute("DeleteFROM"&TableRemark&"WhereArticleID="&arrArticleID(i))EndIfNextDataClose()Response.RedirectUrlEndSubSubArticleBatchMove()DimArticleID,ClassID,NClassIDArticleID=Request.Form("ArticleId")ClassID=Request.Form("ClassID")NClassID=Request.Form("NClassID")IfClassID=""ThenClassID=0IfClassID=0ThenstrMsg="<li>请选择目的分类"CallMsg()ElseIfArticleID=""ThenResponse.RedirectUrlSQL="UPDATE"&TableArticle&"SETClassID="&ClassID&",NClassID="&NClassID&"WhereIdIn("&ArticleID&")"Conn.ExecuteSQLSetRs=NothingDataClose()Response.RedirectUrlEndIfEndSubSubArticleBatchCheck()DimArticleIDArticleID=Request.Form("ArticleId")IfArticleID=""ThenResponse.RedirectUrlSQL="InsertInto"&TableArticle&"(ClassID,NClassID,Title,Content,sKey,Author,WriteFrom,AddUser)"SQL=SQL&"SelectClassID,NClassID,Title,Content,sKey,Author,WriteFrom,AddUser"SQL=SQL&"FROM"&TableArticleNoCheck&"WhereIdIn("&ArticleID&")"Conn.Execute(SQL)Conn.Execute("DeleteFROM"&TableArticleNoCheck&"WhereIdIn("&ArticleID&")")DataClose()Response.RedirectUrlEndSubSubArticleHtml()DimArticleID,arrArticleID,RsHtml,SqlHtml,iDimID,ClassID,NClassID,sKey,Author,AddDate,Hits,WriteFrom,isHtml,AddUser,Editor,htmlIsNo,c_filepathDimrstem,sqltem,DefaultTemplate,fname,folder,htmlyear,htmlmonth,htmlcontent,fout,fso,folders,PageListArticleID=Request.Form("ArticleId")arrArticleID=Split(ArticleID,",")IfArticleID=""ThenResponse.RedirectUrlFori=0toUBound(arrArticleID)SetRsHtml=Server.CreateObject("ADODB.Recordset")SqlHtml="Select*from[Article]WhereID="&arrArticleID(i)'SqlHtml="Select*from[Article]wherec_filepath=''orderbyIDASC"'SqlHtml="Select*from[Article]orderbyIDASC"RsHtml.OpenSqlHtml,Conn,1,1dowhilenotRsHtml.eofID=RsHtml("ID")ClassID=RsHtml("ClassID")NClassID=RsHtml("NClassID")Title=RsHtml("Title")Content=RsHtml("Content")sKey=RsHtml("sKey")Author=RsHtml("Author")AddDate=RsHtml("AddDate")Hits=RsHtml("Hits")WriteFrom=RsHtml("WriteFrom")isHtml=RsHtml("isHtml")AddUser=RsHtml("AddUser")Editor=RsHtml("Editor")htmlIsNo=RsHtml("htmlIsNo")c_filepath=RsHtml("c_filepath")'RsHtml.close'setRsHtml=nothingifc_filepath<>""thenc_filepath=c_filepathelsefname=makefilename()'makefilename为自定义函数htmlyear=year(AddDate)htmlmonth=right("0"&month(AddDate),2)folder="../newsfile/"&htmlyear&"-"&htmlmonth&"/"c_filepath=folder&fname&ID&".html"endifsetrstem=Server.Createobject("Adodb.Recordset")ifNClassID=0thensqltem="SelectTemplateFROMClassWhereID="&ClassIDelsesqltem="SelectTemplateFROMNClassWhereID="&NClassIDendifrstem.Opensqltem,Conn,1,1DefaultTemplate=rstem("Template")rstem.closesetrstem=nothing164行错误Html=Head_Body_Html(DefaultTemplate)<<<----这里显示Head_Body_Html不匹配'Html=Html&DefaultTemplate'页面主体'页面主体Html=Html&ReadFile(DefaultTemplate,"disp")Html=Replace(Html,"{title}",Title)Content=Replace(Content,"UploadFile/ea_","../../UploadFile/ea_")IfisHtml=1ThenHtml=Replace(Html,"{content}",UbbCode(Content,2))ElseHtml=Replace(Html,"{content}",UbbCode(Content,1))EndIfHtml=Replace(Html,"{author}",author)Html=Replace(Html,"{datetime}",AddDate)Html=Replace(Html,"{writefrom}",writefrom)Html=Replace(Html,"{pagelist}",PageList)Html=Replace(Html,"{editor}",Editor)Html=Replace(Html,"{id}",ID)'Html=Replace(Html,"{classid}",ClassID)Html=Replace(Html,"{prvnextarticle}",PrvNextArticle(ID,ClassID,NClassID))Html=Replace(Html,"{other}",GetAboutArticle(sKey,ID))'Response.WriteHtmlHtml=Html&Bottom_Html(DefaultTemplate)Setfso=Server.CreateObject("Scripting.FileSystemObject")folders=Split(c_filepath,"/")folder=folders(0)&"/"&folders(1)&"/"&folders(2)folder=Server.MapPath(folder)IfFso.FolderExists(folder)=FalseThenfso.CreateFolder(folder)EndifSetfout=fso.CreateTextFile(Server.MapPath(c_filepath))fout.WriteLineHtmlfout.closeConn.execute("updateArticlesethtmlIsNo=True,c_filepath='"&c_filepath&"'whereID="&ID)RsHtml.movenextloopRsHtml.closesetRsHtml=nothingNextDataClose()Response.RedirectUrlEndSub

下面是包含文件Template.Asp代码:<%DimClassID,NClassID,strClass,strNClassClassID=CheckStr(Request.QueryString("ClassID"))NClassID=CheckStr(Request.QueryString("NClassID"))SubHead()Html=LoadTemplate("head")Html=Replace(Html,"{site_title}",Site_Info(0))Response.WriteHtmlEndSubSubHead_Body()Html=LoadTemplate("head")&LoadTemplate("head_body")Html=Replace(Html,"{site_title}",Site_Info(0))Html=Replace(Html,"{site_url}",Site_Info(1))Html=Replace(Html,"{site_logo}",Site_Info(3))Html=Replace(Html,"{site_mail}",Site_Info(2))Html=Replace(Html,"{site_banner}",AdRotator(Site_Info(4),Chr(10)))Response.WriteHtmlEndSubSubBottom()Html=LoadTemplate("bottom")ReplaceFoot()Response.WriteHtmlDataClose()EndSubSubGetCurrentTemplate()DimCurrTemplate,cRsIfNClassID=""ThenSQL="SELECTClass,TemplateFROM"&TableClass&"WHEREID="&ClassIDElseSQL="SELECTNClass,TemplateFROM"&TableNClass&"WHEREID="&NClassIDEndIfSetcRs=Conn.Execute(SQL)IfcRs.EOFOrcRs.BOFThenResponse.Redirect"Index.Asp"ElseCurrTemplate=cRs(1)IfCurrTemplate<>""ThenDefaultTemplate=CurrTemplatestrClass=cRs(0)EndIfSetcRs=NothingEndSubSubWriteTitle(Title)Html=Html&"<script>document.title='"&Site_Info(0)&"-"&Title&"'</script>"EndSubFunctionTop_List(Order)DimTitle,TitleColor,Result,ClassID,NClassID,Rs,arrResult,nRowsDimSqlStrSqlStr=NullClassID=CheckStr(Request.QueryString("ClassID"))NClassID=CheckStr(Request.QueryString("NClassID"))IfClassID=""ThenClassID=0IfNClassID=""ThenNClassID=0IfClassID<>0ThenSqlStr="WhereClassID="&ClassIDIfNClassID<>0AndClassID<>0ThenSqlStr="WHEREClassID="&ClassID&"ANDNClassID="&NClassIDSelectCaseOrderCase"top_hotlist"SqlStr=SqlStr&"OrderByHitsDesc,ID"Case"recommendlist"IfClassID<>0ThenSqlStr=SqlStr&"AndisRecommend=1OrderByIDDesc"ElseSqlStr="WhereisRecommend=1OrderByIDDesc"EndIfCaseElseSqlStr="OrderByIDDesc"EndSelectSQL="SelectTop"&Site_Info(10)&"ID,Title,Hits,TitleColorFROM"&TableArticle&""&SqlStrSetRs=Conn.Execute(SQL)IfNot(Rs.EOFOrRs.BOF)ThenarrResult=Rs.GetRows()nRows=UBound(arrResult,2)Fori=0tonRowsTitle=CutStr(arrResult(1,i),22)TitleColor=arrResult(3,i)IfTitleColor<>""ThenTitle="<fontstyle=""color:"&TitleColor&";"">"&Title&"</font>"Result=Result&"<imgsrc='images/jt0.gif'align='absmiddle'border='0'><ahref=""dispArticle.Asp?ID="&arrResult(0,i)&"""Title="""&arrResult(1,i)&"<br>"&"点击:"&arrResult(2,i)&"""target=""_blank"">"&Title&"</a><br>"NextElseResult="<tr><td>尚未添加</td></tr>"EndIfTop_List=ResultSqlStr=""SetRs=NothingEndFunction%>

解决方案

本帖最后由 muksun 于 2011-11-01 20:50:24 编辑
解决方案二:
错误提示是哪一行呢?这么多代码,看起来费时间。问题要描述清楚点。
解决方案三:
是这里有错误,用红色标注的,没有显示出来164行错误Html=Head_Body_Html(DefaultTemplate)<<<----这里显示Head_Body_Html不匹配'Html=Html&DefaultTemplate'页面主体'页面主体
解决方案四:
Head_Body_Html这个函数名称估计弄错了,检查下。
解决方案五:
贴:Head_Body_Html函数出来看看。

时间: 2024-11-10 00:35:39

生成静态html时出现错误“类型不匹配”的相关文章

asp.net 生成静态页时的进度条显示_实用技巧

asp.net如何生成静态页,请参考下面的文章:http://www.jb51.net/article/18175.htm而我们用模拟的话,只需要让线程延迟执行就可以了.比如下面的代码: 复制代码 代码如下: for (int i = 0; i < 10; i++) { DateTime startTime = DateTime.Now; Response.Write(i + "-------------执行时间:" + startTime.ToString()+"&l

蓝牙 读取ServiceRecord时,出现类型不匹配错误

问题描述 问题如题,具体代码如下://首先定义一个Vector类型的records来存服务记录Vector records = new Vector();...........................//获得服务 public void servicesDiscovered(int transID, ServiceRecord[] servRecord) { for (int i = 0; i < servRecord.length; i++) { records.addElement(

ASP.NET,生成静态页面时,代码HttpContext.Current.Server.Execute()出现错误

问题描述 各位大神好,项目里生成HTML静态页面,执行到HtmlProxy类时,出现异常错误HttpContext.Current.Server.Execute("article_detailed.aspx?nid="+id,sw);麻烦各位大神赐教 解决方案 解决方案二:提示已经说了.你的IIS配置的asp.net模式有错误,它不支持asp.net的这个操作.解决方案三:引用1楼sp1234的回复: 提示已经说了.你的IIS配置的asp.net模式有错误,它不支持asp.net的这个

vb.net调用MATLAB通过com组件生成的dll时的错误

问题描述 我通过MATLAB生成了dll,并在vs2008里进行了调用,一开始是可以用的,后来弹出来一个错误是:服务器出现意外情况.(异常来自HRESULT:0x80010105(RPC_E_SERVERFAULT))我把程序关了再打开有时候可以用,有时候还是弹出这句话.检查代码就是执行到调用dll函数的位置出的错误.但是不知道为何有时候不会出错有时候会出错,希望各位大神给予解答.异常详细信息:System.Runtime.InteropServices.COMException:服务器出现意外

TSYS中生成静态页时溢出: &#039;CInt&#039;_应用技巧

今天在添加文章生成静态页是,发生了 溢出: 'CInt'. 经查得知: 原来是CINT不支持太大的数字,估计有一个数值范围吧,所以换成CLNG就解决问题了. 修改TSYS下的MANAGE/INCLUDE/CreateFile_Fun.asp中的第107行.             复制代码 代码如下: If I=0 Then                  '生成文件存放路径                 '原来的提示cint溢出FilePath=CreateFileSaveToPath(C

问大家关于在使用freemarker生成静态页面时,引用其他标签库的问题!

问题描述 代码片段如下publicstaticvoidcrateHTML(HttpServletRequestrequest,Mapdata,StringtemplatePath,StringtargetHtmlPath){ConfigurationfreemarkerCfg=newConfiguration();//加载模版freemarkerCfg.setServletContextForTemplateLoading(request.getSession().getServletConte

TSYS中生成静态页时溢出: 'CInt'

今天在添加文章生成静态页是,发生了 溢出: 'CInt'. 经查得知: 原来是CINT不支持太大的数字,估计有一个数值范围吧,所以换成CLNG就解决问题了. 修改TSYS下的MANAGE/INCLUDE/CreateFile_Fun.asp中的第107行.             复制代码 代码如下:If I=0 Then                  '生成文件存放路径                 '原来的提示cint溢出FilePath=CreateFileSaveToPath(CI

PHP中实现生成静态文件的方法缓解服务器压力

 使用生成静态文件的方法解决服务器与数据库访问压力,下面有个不错的教程,感兴趣的朋友可以参考下 互联网快速普及的现在社会,越来越多的人会在一个web应用上进行交流,因而导致服务器与数据库访问压力与日俱增,这边就需要进行一些优化,譬如增加缓存.二级缓存.动态网页静态化以及其他的高端技术.    此处作者是使用生成静态文件的方法:  代码如下: /**  * @desc 生成静态文件时使用  * @todo htmlcache  * @param $root string html文件存放路径  *

从数据库生成edmx 运行时出错,无法映射

问题描述 从数据库生成edmx运行时出错错误信息:Thetype'neosoft_nnil.users'wasnotmapped.CheckthatthetypehasnotbeenexplicitlyexcludedbyusingtheIgnoremethodorNotMappedAttributedataannotation.Verifythatthetypewasdefinedasaclass,isnotprimitive,nestedorgeneric,anddoesnotinherit