您现在的位置: 军旅同心-旅游自驾-军旅文学 >> 读书赏析 >> 学习园地 >> 电脑网络 >> 技术文章 >> 正文
asp+的论坛列表程序---代码部分
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005-9-10 12:39:38
;             
                  
                  
                  
                }
            }
        }
      catch(Exception exp)
        {
          Response.Write(exp.ToString() ) ;
          //Response.Redirect("error.asp") ;
        }
      finally
        {
          myConnection.Close();
          //Response.Redirect("default.aspx") ;
        }                
      
      
    }
    
  private void GetForumInfo(int a_intForumID)
    {
      SQLConnection myConnection = new SQLConnection("server=server1;uid=sa;pwd=;database=BBS");
      SQLCommand myCommand = new SQLCommand("up_GetForum" , 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 ;
        
         

      
      SQLDataReader myReader ;

      try
        {
          myConnection.Open();
          myCommand.Execute(out myReader);
          
          myReader.Read() ;
          
          //板块名称
          lblForumName.Text  = myReader["CategoryName"].ToString() ;       
          lblForumName.CssClass = "BigTitle" ;
          lblForumName.ToolTip = myReader["Description"].ToString() ;
          lblForumName1.Text = lblForumName.Text ;
          lblForumName1.CssClass = "Title" ;
          lblForumName1.ToolTip = myReader["Description"].ToString() ;

          //贴子数
          lblTopicCounts1.Text = myReader["NewTopicNumber"].ToString() ;
          lblTopicCounts1.ToolTip = "当前贴子数:" + lblTopicCounts1.Text ;


          //oicq
          if (myReader["OICQ"].ToString() != "")
            {
              imgOICQ.Src = "http://infocenter.tencent.com/" + myReader["OICQ"].ToString() + "/s/00/99" ;
              imgOICQ.Alt = "OICQ:" + myReader["OICQ"].ToString() ;
              //imgOICQ.Src = "images/off.gif" ;
            }
          else
            {
              imgOICQ.Src = "" ;
              imgOICQ.Alt = "没留OICQ。" ;
            }    

          //版主
          linkMaster.Text = myReader["UserName"].ToString() ;
          linkMaster.NavigateUrl = (myReader["Email"].ToString() == "" ? "" :
                                  "MailTo:" + myReader["Email"].ToString()) ;
          linkMaster.ToolTip = (myReader["Email"].ToString() == "" ? "版主没留Email," :"写信给版主,");
          
        }
      catch(Exception exp)
        {
          Response.Write(exp.ToString()) ;
          //Response.Redirect("error.asp") ;
        }
      finally
        {
          myConnection.Close();
          //Response.Redirect("default.aspx") ;
        }    
    
   }
   
  //显示转换版面下拉列表
  private void ShowChangeForum(int a_intForumID)
   {
     selChangeForum.Width = 200 ;
     
   }  
}   

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


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