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("暫無相關數(shù)據(jù)!"); } 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()); } }