您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
asp+的论坛列表程序---代码部分
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 12:39:38
             td.Controls.Add(new LiteralControl("目前尚未有人发言!")) ;
              tr.Cells.Add(td) ;
              tblTopic.Rows.Add(tr) ;
            }
          else                                         //否则,显示贴字列表
            {   
              
              while (myReader.Read())
                {
                  String strInnerHtml = "";
                  TableRow tr = new TableRow() ;
                  tr.BackColor = Color.White ;
                  
                  //贴子状态图片
                  TableCell tdStatus = new TableCell() ;
                  if ((int)myReader["TotalChilds"] == 0)
                    {
                      strInnerHtml = "<img src='images/closed.gif' alt='没有新回复。'>" ;
                    }
                  else if((int)myReader["TotalChilds"] < 5)
                    {
                      strInnerHtml = "<img src='images/closedb.gif' alt='有新回复,不过不多。'>";
                    }
                  else if((int)myReader["TotalChilds"] >= 10)
                    {
                      strInnerHtml = "<img src='images/hotclosedb.gif' alt='太火了。'>";
                    }                    
                  else if((int)myReader["TotalChilds"] >= 5)
                    {
                      strInnerHtml = "<img src='images/hotclosed.gif' alt='回复不少。'>";
                    }
                  tdStatus.Controls.Add(new LiteralControl(strInnerHtml)) ;
                  tr.Cells.Add(tdStatus) ;
                  
                  //表情图片
                  TableCell tdFace = new TableCell() ;
                  strInnerHtml = "<img src='images/icon"+myReader["FaceID"].ToString() +".gif'>" ;
                  //Response.Write(strInnerHtml) ;
                  tdFace.Controls.Add(new LiteralControl(strInnerHtml)) ;
                  tr.Cells.Add(tdFace) ;
                  
                  //主题
                  TableCell tdTitle = new TableCell() ;
                  strInnerHtml = "<a href='ShowTopic.aspx?id=" + myReader["ID"].ToString() + "'>"
                                + myReader["Title"].ToString()  + "</a>";
                  tdTitle.Controls.Add(new LiteralControl(strInnerHtml)) ;
                  tr.Cells.Add(tdTitle) ;
                  
                  //作者
                  TableCell tdAuthor = new TableCell() ;
                  strInnerHtml = myReader["UserName"].ToString() ;
                  tdAuthor.Controls.Add(new LiteralControl(strInnerHtml)) ;
                  tr.Cells.Add(tdAuthor) ;
                  
                  //回复数
                  TableCell tdReply = new TableCell() ;
                  strInnerHtml = myReader["TotalChilds"].ToString() ;
                  tdReply.Controls.Add(new LiteralControl(strInnerHtml)) ;
                  tr.Cells.Add(tdReply) ;
                  
                  //最后回复时间
                  TableCell tdReplyTime = new TableCell() ;
                  strInnerHtml = myReader["LastReplyTime"].ToString() ;
                  tdReplyTime.Controls.Add(new LiteralControl(strInnerHtml)) ;
                  tr.Cells.Add(tdReplyTime) ;
                  
                  tblTopic.Rows.Add(tr) ;
     

上一页  [1] [2] [3] [4] 下一页


更多
免责声明:作品版权归所属媒体与作者所有!!本站刊载此文不代表同意其说法或描述,仅为提供更多信息。如果您认为我们侵犯了您的版权,请告知!本站立即删除。有异议请联系我们。
文章录入:烟灰缸    责任编辑:烟灰缸 
网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
| 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 网站地图 | 版权申明 | 网站公告 | 管理登录 |