打印本文 打印本文  关闭窗口 关闭窗口
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] 



打印本文 打印本文  关闭窗口 关闭窗口