前台:就一句话 %@ Page Language="C#" CodeFile="rss.aspx.cs" Inherits="rss" % ----------------------------------------------------------------------------------------------------------------- 后台代码: string strRSS = ""; protected void Page
前台:就一句话
-----------------------------------------------------------------------------------------------------------------
后台代码:
string strRSS = "";
protected void Page_Load(object sender, EventArgs e)
{
Response.ContentType = "application/xml"; // 输出并按xml数据显示
Response.Write(GetRSS());
}
///
/// 取得聚合文章
///
public string GetRSS()
{
//DataSet ds = gr.GenerateRSS(); // 调用GenerateRSS()方法,获得数据
strRSS = strRSS + "";
strRSS = strRSS + "";
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "http://218.106.183.120/";
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "
using (scn = new SqlConnection())
{
scn.ConnectionString = "server=.;uid=sa;pwd=111111;database=pubs;";
scn.Open();
using (sda = new SqlDataAdapter())
{
sda.SelectCommand = scn.CreateCommand();
sda.SelectCommand.CommandText = "select * from jobs";
sda.SelectCommand.ExecuteNonQuery();
DataSet ds = new DataSet();
sda.Fill(ds);
if (ds != null && ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow dr in ds.Tables[0].Rows)
{
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "http://www.com-edu.cn "; //标题链接
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "
strRSS = strRSS + "
}
}
}
}
strRSS = strRSS + "
strRSS = strRSS + "
return strRSS;
}
rss2.0参考
/* 一、注册、报考、缴费时间 2009年4月15日至25日,逾期不予办理。
http://218.106.183.120/
]]>
http://218.106.183.120/showtopic-6.aspx
*/