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

80酷酷网    80kuku.com

  想自己生成自己站点的频道文件吗,看看下面的代码把。
这只是个例子而已,但我想你完全可以根据它来建立你自己的频道。
以后只要用户下载该.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 "santrypin-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("H

分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: