以下是引用片段:
<%'接受传递值 Title=request.form("Title") BidMeetingTime=request.form("BidMeetingTime")''''''''''''''展会时间 BidMeetingLocation=request.form("BidMeetingLocation")''''''''''''展会地点 'response.write title 'response.end() Author=request.form("Author") Keyword_1=request.form("Keyword_1") Keyword_2=request.form("Keyword_2") Keyword_3=request.form("Keyword_3") Keyword_4=request.form("Keyword_4") Keyword_5=request.form("Keyword_5") Froms=request.form("Froms") CreateTime=request.form("CreateTime") ViewTimes=request.form("ViewTimes") FirstClass=request.form("FirstClass") SecondClass=request.form("SecondClass") ThirdClass=request.form("ThirdClass") 'response.write SecondClass 'response.End() 'ThirdClass=request.form("ThirdClass") Content1=request.form("Content1") IsCheckPass=request.form("IsCheckPass") IsHotPoint=request.form("IsHotPoint") IsRecommend=request.form("IsRecommend")
%>
<%'生成HTML文件名,建立文件夹,指定文件路径
fname = makefilename(now()) 'makefilename为自定义函数
StaticFilePath=date()&"/"&fname&".shtml"'存储在数据库中的路径
folder = "../../allfiles/NewsInfo/newsfile/"&date()&"/"
filepath = folder&fname

%>

<%'将接受值及路径保持至数据库表
sql = "insert into inNews(Title,Author,Keyword_1,Keyword_2,Keyword_3,Keyword_4,Keyword_5,Froms,FirstClass,SecondClass,ThirdClass,Content1,IsCheckPass,IsHotPoint,IsRecommend,StaticFilePath,BidMeetingTime,BidMeetingLocation) values('"&Title&"','"&Author&"','"&Keyword_1&"','"&Keyword_2&"','"&Keyword_3&"','"&Keyword_4&"','"&Keyword_5&"','"&Froms&"','"&FirstClass&"','"&SecondClass&"','"&ThirdClass&"','"&Content1&"','"&IsCheckPass&"','"&IsHotPoint&"','"&IsRecommend&"','"&StaticFilePath&"','"&BidMeetingTime&"','"&BidMeetingLocation&"')"
'response.write sql
'response.end
Set rsinsert = Server.CreateObject ("ADODB.Recordset")
rsinsert.Open sql,conn,1,3
Set rsinsert = Nothing

%>
 <% ContentStr=split(Content1,"|||") PageNumber=ubound(ContentStr) 'response.write PageNumber 'response.end() 'if PageNumber=0 then For p = 0 to ubound(ContentStr) '打开模板代码,并将其中特殊代码转变为接受值 Dim fso,fin '创建文件系统对象 Set fso=Server.CreateObject("Scripting.FileSystemObject") Model="../../allfiles/NewsInfo/news/Topic_civil_tec.shtml"
Set fin=fso.OpenTextFile(Server.MapPath(""&Model&"")) mb_code=fin.ReadAll fin.close
Title=htmlencode(Title) Content=htmlencode(Content) mb_code=replace(mb_code,"$Title",Title) mb_code=replace(mb_code,"$Author",Author) mb_code=replace(mb_code,"$Keyword_1",Keyword_1) mb_code=replace(mb_code,"$Keyword_2",Keyword_2) mb_code=replace(mb_code,"$Keyword_3",Keyword_3) mb_code=replace(mb_code,"$Keyword_4",Keyword_4) mb_code=replace(mb_code,"$Keyword_5",Keyword_5) mb_code=replace(mb_code,"$Froms",Froms) mb_code=replace(mb_code,"$CreateTime",formatdatetime(now(),2)) if ThirdClass<>"" then mb_code=replace(mb_code,"$ThirdNewsClassId",ThirdClass)''''''替换模板中js中的特殊字符 end if 'mb_code=replace(mb_code,"$ViewTimes",ViewTimes) mb_code=replace(mb_code,"$Content1",ContentStr(p))
if PageNumber>0 then MyPagerTable="<table width=""60%"" border=""0"" cellpadding=""0"" cellspacing=""1""><tr><td height=""25""><a href=""$UrlUp""><font color=""ff0000""><strong>[上一页]</strong></font></a></td><td height=""30""><a href=""$UrlDown""><font color=""ff0000""><strong>[下一页]</strong></font></a></td></tr></table>"''''''''''下一页代码,用于替换 if p<=1 then''''''''''分页 MyPagerTable=replace(MyPagerTable,"$UrlUp",fname&".shtml") if p=PageNumber then MyPagerTable=replace(MyPagerTable,"$UrlDown",fname&"_"&p&".shtml") else MyPagerTable=replace(MyPagerTable,"$UrlDown",fname&"_"&p+1&".shtml") end if else MyPagerTable=replace(MyPagerTable,"$UrlUp",fname&"_"&p-1&".shtml") if p=PageNumber then MyPagerTable=replace(MyPagerTable,"$UrlDown",fname&"_"&p&".shtml") else MyPagerTable=replace(MyPagerTable,"$UrlDown",fname&"_"&p+1&".shtml") end if end if mb_code=replace(mb_code,"$MyPager",MyPagerTable) else mb_code=replace(mb_code,"$MyPager","") end if 'mb_code=replace(mb_code,"$FirstClass",FirstClass) 'mb_code=replace(mb_code,"$SecondClass",SecondClass) 'mb_code=replace(mb_code,"$ThirdClasses",ThirdClasses) '选出新添加的新闻的id set rsid=server.createobject("adodb.recordset") sql="select top 1 NewsId from inNews order by NewsId desc" rsid.open sql,conn,1,3 mb_code=replace(mb_code,"$NewsId",rsid("NewsId"))'替换浏览次数中的编号 rsid.close set rsid=nothing %>
<%'生成HTML页面 'Set fso = Server.CreateObject("Scripting.FileSystemObject") On Error Resume Next '容错处理 fso.CreateFolder(Server.MapPath(folder)) if p=0 then Set fout = fso.CreateTextFile(Server.MapPath(filepath&".shtml")) else Set fout = fso.CreateTextFile(Server.MapPath(filepath&"_"&p&".shtml")) end if fout.WriteLine mb_code fout.close next %> |
回首页
随机推荐文章→
□平面设计之路 □名片设计要素 □音乐网站海报设计 □创意的灵感设计 □品牌平面设计
设计说明:ASP静态页面内容分页平面设计,威迪广告公司为您提供设计欣赏,创意生活,设计欣赏,当代艺术,数字娱乐,平面设计,视觉,平面,fireworks,教程,书籍,封面,设计,标志,广告,作品,图片,下载多元化的信息交流咨询,杭州ASP静态页面内容分页视觉引导式的宣传方法让人过目难忘。将光线巧妙地运用在书籍的投影上,视觉,平面,fireworks,教程,书籍,封面,设计似乎书籍由内向外透着一股亮光。书上的窗户和灯泡都是设计欣赏将书从平面转换到空间的一个过渡,这些过渡让人们更想探寻亮光后面的另一个空间。ASP静态页面内容分页平面设计的文化招贴中两本书直接交叉,纯粹的制造出标志,广告,作品,图片,下载一种强烈的立体空间感.
杭州平面设计
【威迪公司】
杭州VI设计
杭州标志设
杭州企业LOGO设计
杭州名片设计
杭州画册设
杭州网页设
杭州广告设计
杭州包装设计
添加时间:2008-6-28
TOP↑
本站部分文章搜集自网络,若侵犯了您的版权请联系E-mail:774665@qq.com,本站核实后立即删除!
|