急求新闻页面动态生成代码!!!!!!!!!

沙枣花开-沁人的香 2009-07-13 10:11:24
本以为这部分不是很难,没想到在这遇到麻烦了,做作了模板asp页面,每次从数据库里读新闻内容,但是总不能自动分段等,只是内容的堆砌,说要改成HTML,用了网上的转换函数也不行,又看到要用FSO,彻底没谱了,高手快帮忙吧
...全文
42 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
x196231222 2009-07-14
  • 打赏
  • 举报
回复
学习了。。。。。
  • 打赏
  • 举报
回复
谢谢,去下,顶了
落日听风 2009-07-14
  • 打赏
  • 举报
回复
http://download.csdn.net/source/1383075 我资源里有
  • 打赏
  • 举报
回复
没用模板,就是用符号间的转换做了,这样简单点.功能是实现了.
凡夫与俗子 2009-07-14
  • 打赏
  • 举报
回复
顶一楼,楼主慢慢调试吧。
lzp4881 2009-07-14
  • 打赏
  • 举报
回复
按模板生成网站首页


<%
Response.Expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
Response.Buffer = True
Response.Clear
Server.ScriptTimeOut=999999999
on error resume next
'***************************************************************
'* 定义 从模板从读取首页 函数
'* 说明:模板文件名为:index_Template.asp
'***************************************************************
Function GetPage(url)
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetPage = BytesToBstr(.ResponseBody)
End With
Set Retrieval = Nothing
End Function
Function BytesToBstr(body)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = "GB2312"
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function

'***************************************************************
'* 生页首页,文件名为:default.htm
'***************************************************************
dim Tstr
Tstr = GetPage("http://www.adhome.net/index_Template.asp")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(Server.MapPath(".")&"/default.htm")
fout.Write Tstr
fout.close
Response.write"<script>alert(""生成首页成功!\n\n文件名为:default.htm"");location.href="http://www.adhome.net";</script>"
Response.end
%>
qizhicong2 2009-07-14
  • 打赏
  • 举报
回复
楼主慢慢调试吧。

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧