dal_Collection dc = new dal_Collection(); Label1.Text = dc.GetIndexZouMaDeng();
dal_Collection.GetIndexZouMaDeng()的代码:
[csharp]
复制代码 代码如下:
using System.Text;
[csharp]
复制代码 代码如下:
public string GetIndexZouMaDeng() {
StringBuilder res = new StringBuilder(); DataTable dt0 = GetNewsPageDB("select top 10 CN_Id, CN_Title,CN_Intro,CN_Url,CN_Uid,CN_Times from Collection order by CN_Times desc"); if (dt0.Rows.Count == 0) { res.Append("暂无相关数据!"); } else { for (int i = 0; i dt0.Rows.Count; i++)//参见【注释1】 { res.Append("td align=\"center\" height=\"139\" width=\"184\">img height=\"135\" src=\"" + dt0.Rows[i][3].ToString().Substring(2) + "\" width=\"180\" />/td>");
} if (dt0.Rows.Count = 6) { res.Append(res.ToString()); } }