?? reply_article.aspx.cs
字號:
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 yezhuforum
{
/// <summary>
/// reply_article 的摘要說明。
/// </summary>
public class reply_article : System.Web.UI.Page
{
protected int intRunTime;
protected System.Web.UI.HtmlControls.HtmlInputText password;
protected DateTime dtStartTime = DateTime.Now;
public string usercookies;
public string f3title;
public string f3content;
public string freply;
public string f3name;
public string f3date;
public DateTime f3time;
protected System.Data.OleDb.OleDbCommand cmd;
protected System.Data.OleDb.OleDbConnection conn;
public DataSet dsPending1;
public string sql1;
public DataSet dsPending;
public string sql;
private void Page_Load(object sender, System.EventArgs e)
{
if (Request.Cookies["jusername"]!=null)
{
usercookies=Request.Cookies["jusername"].Value;
}
else
{
Response.Redirect("logine.aspx");
}
conn = new OleDbConnection(ConfigurationSettings.AppSettings["cnFriends.ConnectionString"]);
//搜索主題信息
sql="select f3_motif,f3_content,f3_name,f3_date,f3_time from forum_3 where f3_id="+Request.QueryString["f3_id"]+"";
dsPending=new DataSet();
OleDbDataAdapter adWord=new OleDbDataAdapter(sql,conn);
adWord.Fill(dsPending,"forum_3");
Page.DataBind();
f3title=Convert.ToString(dsPending.Tables[0].Rows[0]["f3_motif"]);
if (Convert.ToString(Request.QueryString["reply"])=="2")
{
f3content=Convert.ToString(dsPending.Tables[0].Rows[0]["f3_content"]);
f3name=Convert.ToString(dsPending.Tables[0].Rows[0]["f3_name"]);
f3date=Convert.ToString(dsPending.Tables[0].Rows[0]["f3_date"]);
freply="[quote][b]以下是引用"+f3name+"在"+f3date+"的發言:[/b]\n"+f3content+"[/quote]";
dsPending.Clear();
}
if (Convert.ToString(Request.QueryString["reply"])=="3")
{
//搜索回復信息
sql1="select f4_content,f4_name,f4_date,f4_time from forum_4 where f4_id="+Request.QueryString["f4_id"]+"";
dsPending1=new DataSet();
OleDbDataAdapter adWord1=new OleDbDataAdapter(sql1,conn);
adWord1.Fill(dsPending1,"forum_4");
Page.DataBind();
f3content=Convert.ToString(dsPending1.Tables[0].Rows[0]["f4_content"]);
f3name=Convert.ToString(dsPending1.Tables[0].Rows[0]["f4_name"]);
f3date=Convert.ToString(dsPending1.Tables[0].Rows[0]["f4_date"]);
freply="[quote][b]以下是引用"+f3name+"在"+f3date+"的發言:[/b]\n"+f3content+"[/quote]";
dsPending1.Clear();
}
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
private void Repeater1_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
{
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -