list.aspx.cs
资源名称:论坛源码.rar [点击查看]
上传用户:scene123
上传日期:2010-02-19
资源大小:3311k
文件大小:3k
源码类别:
.net编程
开发平台:
C#
- using System;
- using System.Collections;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Web;
- using System.Web.SessionState;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.HtmlControls;
- using System.Data.OleDb;
- using System.Configuration;
- using System.Text;
- using System.Web.Security;
- using System.Security.Cryptography;
- namespace kuangren
- {
- /// <summary>
- /// list 的摘要说明。
- /// </summary>
- public class list : System.Web.UI.Page
- {
- protected int intRunTime;
- protected DateTime dtStartTime = DateTime.Now;
- protected System.Data.OleDb.OleDbConnection conn;
- protected System.Data.OleDb.OleDbCommand cmd1;
- protected System.Web.UI.WebControls.Repeater parent;
- public DataSet dsPending1;
- public string f1name;
- public string sql1;
- protected string dotrim(string f2_lasttopic,int intlength)
- {
- if(f2_lasttopic=="")
- {
- return "null";//可以任意写
- }
- else
- {
- if(f2_lasttopic.Length>intlength)
- {
- return f2_lasttopic.Substring(0,intlength)+"..";
- }
- else
- {
- return f2_lasttopic;
- }
- }
- }
- public string GetPath(object o)
- {
- if (Convert.IsDBNull(o) || (string)o == "")
- return "";
- else
- return "<img src="+o+">";
- }
- public string GetPath1(object o)
- {
- if ((string)o == "1")
- return "skin/dvbbs/images/forum_lock.gif";
- else
- return "skin/dvbbs/images/forum_nonews.gif";
- }
- protected string getModerator(string strModerators)
- {
- StringBuilder strResult = new StringBuilder();
- if (strModerators != "")
- {
- string[] strModerator = strModerators.Split('|');
- foreach (string strInfos in strModerator)
- {
- strResult.Append("<a href="user_infor.aspx?u_user=");
- strResult.Append(strInfos);
- strResult.Append("" target="_blank">");
- strResult.Append(strInfos);
- strResult.Append("</a> ");
- }
- }
- else
- {
- strResult.Append("暂无版主");
- }
- return strResult.ToString();
- }
- private void Page_Load(object sender, System.EventArgs e)
- {
- conn = new OleDbConnection(ConfigurationSettings.AppSettings["cnFriends.ConnectionString"]);
- //搜索对应论坛
- DataSet ds = new DataSet();
- OleDbDataAdapter cmd1 = new OleDbDataAdapter("select * from forum_2 where f2_sy="+Request.QueryString["f1_id"]+" order by f2_by asc ",conn);
- conn.Open();
- cmd1.Fill(ds,"forum_2");
- //Create a second DataAdapter for the Titles table.
- //Bind the Authors table to the parent Repeater control, and call DataBind.
- parent.DataSource = ds.Tables["forum_2"];
- Page.DataBind();
- //搜索论坛大类
- sql1="select f1_caption from forum_1 where f1_id="+Request.QueryString["f1_id"]+"";
- dsPending1=new DataSet();
- OleDbDataAdapter adWord1=new OleDbDataAdapter(sql1,conn);
- adWord1.Fill(dsPending1,"forum_1");
- Page.DataBind();
- f1name=Convert.ToString(dsPending1.Tables[0].Rows[0]["f1_caption"]);
- conn.Close();
- }
- #region Web 窗体设计器生成的代码
- override protected void OnInit(EventArgs e)
- {
- //
- // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
- //
- InitializeComponent();
- base.OnInit(e);
- }
- /// <summary>
- /// 设计器支持所需的方法 - 不要使用代码编辑器修改
- /// 此方法的内容。
- /// </summary>
- private void InitializeComponent()
- {
- this.Load += new System.EventHandler(this.Page_Load);
- }
- #endregion
- }
- }