欢迎光临
我们一直在努力

以前收集的一些资料—使用ASP推出你自己网站的频道

建站超值云服务器,限时71元/月

想自己生成自己站点的频道文件吗,看看下面的代码把。
这只是个例子而已,但我想你完全可以根据它来建立你自己的频道。
以后只要用户下载该.cdf文件,用户就能够订阅你的站点的频道了。
                    <%
                    打开数据库连接,并定义用于格式化的变量.
                    set dbconn = server.createobject("adodb.connection")
                    dbconn.open "dsn=yourdsn"

                    br = chr(10)
                    quote = chr(34)

                    用来生成频道格式
                    body = "<channel " & br
                    body = body & "title = " & quote & "你的公司名" & quote & br
                    body = body & "longname = " & quote & "你的详细公司名" & quote & br
                    body = body & "abstract = " & quote & "你的频道说明" & quote & br
                    在你网站上生成的频道文件(.cdf)
                    body = body & "self = " & quote & "http://yoururl/pointcast.cdf" & quote & br
                    body = body & "contentid = " & quote & "0" & quote & br
                    body = body & "ratings = " & quote & "(pics-1.1
                    "http://www.rsac.org/ratingsv01.html" l gen true comment "rsaci north america
                    server" by "santry@pin-santry.com" for "http://yoururl.com" on
                    "1997.09.18t17:57-0800" r (n 0 s 0 v 0 l 0))" & quote & br
                    body = body & "frequency = " & quote & "24" & quote & br
                    body = body & "authenticate = " & quote & "no" & quote & br
                    body = body & ">" & br & br

                    sqlq = "select * from yourdb where enterdate = #" & date() & "#"
            这将把今天的新东西都推出去
                    set makechannel = dbconn.execute(sqlq)
                    do until makechannel.eof
                        body = body & "<item " & br
                        body = body & "title = " & quote & makechannel("headline") & quote & br
                    在本例子中使用数据库,下面的代码指向数据库入口。也就是你今天想要显示的文章。
                        body = body & "href = " & quote & "http://yoururl/pointcast-news.asp?article=" &
                    makechannel("filename") & quote & br
                        body = body & "type = " & quote & "html" & quote & br
                        body = body & "show = " & quote & "channel" & quote & br
                        body = body & "precache = " & quote & "yes" & quote & br
                        body = body & "authenticate = " & quote & "no" & quote & br
                        body = body & ">" & br
                        body = body & "</item>" & br & br
                        makechannel.movenext
                    loop
                    body = body & "</channel>"
                    set fs = createobject("scripting.filesystemobject")

                    生成第一个文件,每次更新时覆盖上一个文件。
                    set a = fs.createtextfile("d:\yourlocaldrive\pointcast.cdf", true)
                    a.writeline(body)
                    a.close
                    %>

                     

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 以前收集的一些资料—使用ASP推出你自己网站的频道
分享到: 更多 (0)