欢迎来到天天文库
浏览记录
ID:8553994
大小:40.00 KB
页数:11页
时间:2018-04-01
《asp调用模板生成html----asp文件(更新代码)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、asp调用模板生成html----asp文件(更新代码)TheASPcalltemplategeneratesthehtml----aspfile(updatedcode)Thursday,December31,2009,05:30p.m."--#includefile="CONN.ASP"-->!2、-------------------------------'openfileprocedurefunction'FunctionOpenfile(URL)Dim,fileurl,mfile,content,FSOFileurl=Server.MapPath(URL)SetFso=Server.CreateObject('Scripting.Filesystemobject')'definesFSO"Setmfile=Fso.OpenTextFile(fileurl,1)"opensthefileinreadmodeIfNotmfile.AtEndOfStreamThenC3、ontent=mfile.ReadAll()readallofthecontentEndIfMfile.CloseOpenFile=contentEndFunction'----------------------------------------------------ThelegendaryRS...NoexplanationSetrs=Server.CreateObject("ADODB.RecordSet")SQL="select*,from,Table_News,order,sys_id,DESC,by".Thisisthenameofthenameinmydat4、abase.PleasechangeitbyyourselfRs.Open,SQL,Conn,1,1'----------------------------------------------------"Tomakeajudgment,thisexampleisonlytoachieveeffect,pleaseincreaseyourownsecuritydetectionRsnum=rs.recordcount'toreadallthedatainthedatabasejusttobeabletodisplaynormallyPage=CInt(request.For5、m('page'))'takesthenumberofpagesintheformtogenerateFolder=Trim(request.Form("folder")).Createfolderoptionsintheform.Notethatthereisnodetectionhere.It'sasecurityhazard'----------------------------------------------------'userinputundersimplejudgmentIfIsNumeric(page)=falseThen"Response.Writep6、age&""nonnumeric".Pleasere-enter!"Response.End()ElseIfPage>rsnumThenPage=rsnumEndIfEndIfIfpage="Then"Page=rsnumEndIf'----------------------------------------------------'simplyjudgewhethertousethedefaultfolderIfFolder="Then"Folder="news""EndIf'-----------------------------------------------7、-----ForI=1,To,page'startprocessingvariableshereandgetresults“----------------------------------------------------“下面的几个赋值变量我就不解释了吧?关键词=RS(“news_keyword”)标题=RS(“news_topic”)身体=RS(“news_content”)底=RS(“news_time”)“删掉不用开始“当时为了做上一篇下一篇的演示,做了左右和美元美元,可以不用“-----
2、-------------------------------'openfileprocedurefunction'FunctionOpenfile(URL)Dim,fileurl,mfile,content,FSOFileurl=Server.MapPath(URL)SetFso=Server.CreateObject('Scripting.Filesystemobject')'definesFSO"Setmfile=Fso.OpenTextFile(fileurl,1)"opensthefileinreadmodeIfNotmfile.AtEndOfStreamThenC
3、ontent=mfile.ReadAll()readallofthecontentEndIfMfile.CloseOpenFile=contentEndFunction'----------------------------------------------------ThelegendaryRS...NoexplanationSetrs=Server.CreateObject("ADODB.RecordSet")SQL="select*,from,Table_News,order,sys_id,DESC,by".Thisisthenameofthenameinmydat
4、abase.PleasechangeitbyyourselfRs.Open,SQL,Conn,1,1'----------------------------------------------------"Tomakeajudgment,thisexampleisonlytoachieveeffect,pleaseincreaseyourownsecuritydetectionRsnum=rs.recordcount'toreadallthedatainthedatabasejusttobeabletodisplaynormallyPage=CInt(request.For
5、m('page'))'takesthenumberofpagesintheformtogenerateFolder=Trim(request.Form("folder")).Createfolderoptionsintheform.Notethatthereisnodetectionhere.It'sasecurityhazard'----------------------------------------------------'userinputundersimplejudgmentIfIsNumeric(page)=falseThen"Response.Writep
6、age&""nonnumeric".Pleasere-enter!"Response.End()ElseIfPage>rsnumThenPage=rsnumEndIfEndIfIfpage="Then"Page=rsnumEndIf'----------------------------------------------------'simplyjudgewhethertousethedefaultfolderIfFolder="Then"Folder="news""EndIf'-----------------------------------------------
7、-----ForI=1,To,page'startprocessingvariableshereandgetresults“----------------------------------------------------“下面的几个赋值变量我就不解释了吧?关键词=RS(“news_keyword”)标题=RS(“news_topic”)身体=RS(“news_content”)底=RS(“news_time”)“删掉不用开始“当时为了做上一篇下一篇的演示,做了左右和美元美元,可以不用“-----
此文档下载收益归作者所有