c#.net 动态读取 走马灯代码实例分享(2)


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=https://www.jb51.net/article/\"center\" height=https://www.jb51.net/article/\"139\" width=https://www.jb51.net/article/\"184\"><img height=https://www.jb51.net/article/\"135\" src=https://www.jb51.net/article/\"" + dt0.Rows[i][3].ToString().Substring(2) + "https://www.jb51.net/article/\" width=https://www.jb51.net/article/\"180\" /></td>");

            }
            if (dt0.Rows.Count <= 6)
            {
                res.Append(res.ToString());
            }
        }

        return res.ToString();
    }

您可能感兴趣的文章:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wjgfjp.html