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

前台html及js脚本:

[html]

复制代码 代码如下:


   
       
           
       
       
           
       
       
           
       
   
                style="WIDTH: 990px; HEIGHT: 5px; BACKGROUND-COLOR: #ffffff; text-align: center;">
           

               
                   
                       
                   
               

                           

                               
                                    style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 0px">
                                                                            style="WIDTH: 900px; HEIGHT: 139px">
                                       
                                           
                                           
                                       
                                   

                                               
                                                   
                                                       

                                               

                                           

                                           

                               


                               

                       

           

           



 

 cs页的代码:

[csharp]

复制代码 代码如下:

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("");

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

        return res.ToString();
    }

你可能感兴趣的:(c#.net 动态读取 走马灯代码实例分享)