📄 editcontent.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.Odbc;
public partial class adminsss_editcontent : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["passport"] == null)
{
//Response.Write("你没有权限访问此页面!");
Response.Redirect("adminlogin.aspx");
return;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
// Response.Write(TextBox1 .Text +" "+DropDownList1 .SelectedValue +" "+TextBox2.Text +" "+RadioButton1 .Checked +" "+TextArea1 .Value);
int recommend = 0;
if (RadioButton1.Checked)
{
recommend = 1;
}
OdbcConnection con = new OdbcConnection();
con.ConnectionString = "Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\\kang3\\App_Data\\s.mdb;Uid=Admin;Pwd=; ";
con.Open();
OdbcCommand cmd = new OdbcCommand("insert into baojianwangshujukudb(title,kind,author,content,times,isrecommend) values ('" + TextBox1.Text + "','" + DropDownList1.SelectedValue + "','" + TextBox2.Text + "','" + TextArea1.Value + "',now(),'" + recommend + "')", con);
int n=cmd.ExecuteNonQuery();
if (0 != n)
{
Response.Write(n + "增加记录成功!");
Response.Write("<script language=javascript> alert('增加记录成功!')</script>");
TextBox1.Text = "";
TextBox2.Text = "";
TextArea1.Value = "";
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -