您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
asp+的论坛列表程序---代码部分
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 12:39:38
       + "&PageNo=" + (intPageNo - 1).ToString() ;
          linkPrevPage1.ToolTip     = "回到上一页。" ;
        }
     else
        {
          linkPrevPage.ToolTip     = "你现在就位于第一页,你还想上哪儿?" ;
          linkPrevPage1.ToolTip     = "你现在就位于第一页,你还想上哪儿?" ;
        }
     
     //后页
     if (intPageNo < intPageCount )
       {
         linkNextPage.NavigateUrl  = "forum.aspx?" + "ID=" + intForumID.ToString()
                                    + "&PageNo=" + (intPageNo + 1).ToString() ;
         linkNextPage.ToolTip      = "到下一页。" ;
         linkNextPage1.NavigateUrl  = "forum.aspx?" + "ID=" + intForumID.ToString()
                                    + "&PageNo=" + (intPageNo + 1).ToString() ;
         linkNextPage1.ToolTip      = "到下一页。" ;
       }
     else
       {
         linkNextPage.ToolTip      = "你现在就位于最后一页,你还想上哪
儿?" ;                                                                               
         linkNextPage1.ToolTip      = "你现在就位于最后一页,你还想上哪
儿?" ;                                                                               
       }
       
     //末页
     if (intPageNo != intPageCount)
       {
         linkLastPage.NavigateUrl  = "forum.aspx?" + "ID=" + intForumID.ToString()
                                    + "&PageNo=" + intPageCount.ToString() ;
         linkLastPage.ToolTip      = "到最后一页。" ;
         linkLastPage1.NavigateUrl  = "forum.aspx?" + "ID=" + intForumID.ToString()
                                    + "&PageNo=" + intPageCount.ToString() ;
         linkLastPage1.ToolTip      = "到最后一页。" ;
       }
     else
       {
         linkLastPage.ToolTip      = "你现在就位于最后一页。" ;
         linkLastPage1.ToolTip      = "你现在就位于最后一页。" ;
       }                                 
        
        
      //贴子列表
      ShowTopicList(intForumID , 0 , intPageNo , intPageSize) ;
      
      //显示转换版面下拉列表
      ShowChangeForum(intForumID) ;
    }

  private void ShowTopicList(int a_intForumID , int a_intDays , int a_intPageNo , int a_intPageSize)
    {
      
      //读出纪录
      SQLConnection myConnection = new SQLConnection("server=server1;uid=sa;pwd=;database=BBS");
      SQLCommand myCommand = new SQLCommand("up_TopicsList" , myConnection);

      myCommand.ActiveConnection = myConnection ;
      myCommand.CommandType = CommandType.StoredProcedure;
      
      SQLParameter workParam = null;

      //论坛id
      workParam = myCommand.Parameters.Add(new SQLParameter("@a_ForumID", SQLDataType.Int, 4));
      workParam.Direction = ParameterDirection.Input;
      workParam.Value = a_intForumID ;
        
         
      //限定天数
      workParam = myCommand.Parameters.Add(new SQLParameter("@a_intDays", SQLDataType.Int, 4));
      workParam.Direction = ParameterDirection.Input;
      workParam.Value = a_intDays ;
      
      //页号
      workParam = myCommand.Parameters.Add(new SQLParameter("@a_intPageNo", SQLDataType.Int, 4));
      workParam.Direction = ParameterDirection.Input;
      workParam.Value = a_intPageNo ;
      
      //每页显示数
      workParam = myCommand.Parameters.Add(new SQLParameter("@a_intPageSize", SQLDataType.Int, 4));
      workParam.Direction = ParameterDirection.Input;
      workParam.Value = a_intPageSize ;
      
      SQLDataReader myReader ;

      try
        {
          myConnection.Open();
          myCommand.Execute(out myReader);
          //Response.Write(myReader.HasValue.ToString());
          
          //取纪录
          if (lblTopicCounts.Text.ToInt32() == 0)        //如果没有发言
            {
              TableRow tr = new TableRow() ;
              tr.BackColor = Color.White ;
              TableCell td = new TableCell() ;
              td.ColumnSpan = 6 ;
              td.VerticalAlign = VerticalAlign.Middle ;
              td.HorizontalAlign = HorizontalAlign.Center ;
              td.Height  =200 ;
 

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


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