📄 admin_manage.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 Admin_manage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
SqlConnection myConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
protected void LinkButton1_Click(object sender, EventArgs e)
{
Response.Redirect("Admin.aspx?admin_name=" + Session["admin_name"]);
}
protected void Button1_Click(object sender, EventArgs e)
{
string str = "delete from loginer where login_name='" + TextBox1.Text + "'";
SqlCommand myCmd = new SqlCommand(str, myConn);
try
{
myConn.Open();
delete();
myCmd.ExecuteNonQuery();
}
catch (SqlException ex)
{
throw new Exception(ex.Message, ex);
}
finally
{
myConn.Close();
Response.Redirect("Admin_manage.aspx?admin_name=" + Session["admin_name"]);
}
}
public void delete()
{
string cmdText = "delete from lend where login_name='" + TextBox1.Text + "'";
SqlCommand myCommand = new SqlCommand(cmdText, myConn);
myCommand.ExecuteNonQuery();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -