📄 adminreply.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class adminreply : System.Web.UI.Page
{
SqlCommand cmd, cmd2;
SqlConnection cn;
string strsql, strsql2;
protected void Page_Load(object sender, EventArgs e)
{
this.Labusername.Text = Convert.ToString(Session["adminname"]);
if (!this.IsPostBack)
{
if (Session["adminname"] == null)
{
Response.Redirect("index.aspx");
}
else
{
int i;
ArrayList n;
n = new ArrayList();
for (i = 0; i <= 49; i++)
{
n.Add(i.ToString());
}
this.face1.DataSource = n;
this.face1.DataBind();
}
}
}
protected void Button2_Click(object sender, EventArgs e)
{
this.txtcontent.Text = "";
this.txtcontent.Focus();
}
protected void Button1_Click(object sender, EventArgs e)
{
if (this.IsValid)
{
int id = int.Parse(Request .QueryString ["id"]);
cn = sqldata.createcon();
cn.Open();
strsql = "update guestbook set reply='" + this.txtcontent.Text.ToString().Trim() + "',rename='" + this.Labusername.Text.ToString() + "',replyimg='" + this.face1.SelectedItem.Value.ToString() + "',replytime=getdate() where id='"+id+"'";
cmd = new SqlCommand(strsql, cn);
cmd.ExecuteNonQuery();
cn.Close();
this.Labmassage.Text = "回复成功";
this.HyperLink1.Visible = true;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -