Web/feed.aspx.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using COCOWO.COMP;
using COCOWO.DB;
public partial class feed : System.Web.UI.Page
{
blog_Content Blog_Content = new blog_Content();
blog_Smilies Blog_Smilies = new blog_Smilies();
blog_Keywords Blog_Keywords = new blog_Keywords();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Response.ContentType = "text/xml";
Response.Write(WriteRss());
}
}
private string WriteRss()
{
StringBuilder strCode = new StringBuilder();
string SQL = "log_IsDraft = 0 and Log_cateID=" + QueryString.GetCateID;
DataView mydv = Blog_Content.GetContentList(SQL, "log_ID DESC","30", QueryString.IntPage.ToString(), "0");
DataView Smilies = Blog_Smilies.Smilies_List();
DataView KeywordsContent = Blog_Keywords.Keywords_List();
strCode.Append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
strCode.Append("<rss version=\"2.0\">");
strCode.Append("<channel>");
strCode.Append("<title>" + Application["SiteName"] .ToString()+ "</title>");
strCode.Append("<link>" + Application["SiteURL"] .ToString()+ "</link> ");
strCode.Append("<description>" + Application["blog_Title"].ToString() + "</description>");
strCode.Append("<copyright>" + Application["blog_version"] .ToString()+ "</copyright> ");
strCode.Append("<language>zh-cn</language>");
for (int i = 0; i < mydv.Count;i++ )
{
string strTitle = mydv[i]["log_Title"].ToString();
string strDescription = StringUtil.UBBCode(StringUtil.UnCheckStr(mydv[i][10].ToString()), mydv[i][14].ToString().Substring(1, 1).ToString(), "0", mydv[i][14].ToString().Substring(0, 1).ToString(), mydv[i][14].ToString().Substring(2, 1).ToString(), mydv[i][14].ToString().Substring(3, 1).ToString(), Smilies, KeywordsContent);
string strAuthor = mydv[i]["log_Author"].ToString();
string strLink = Application["SiteURL"].ToString() + "article.asp?id=" + mydv[i]["log_ID"].ToString();
string strPubdate = mydv[i]["log_PostTime"].ToString();
strCode.Append("<item>");
strCode.Append("<title>" + strTitle + "</title>");
strCode.Append("<description><![CDATA[" + strDescription + "]]></description>");
strCode.Append("<author>" + strAuthor + "</author>");
strCode.Append("<link>" + strLink + "</link>");
strCode.Append("<pubdate>" + strPubdate + "</pubdate>");
strCode.Append("</item>");
后面还有 8 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
