?? adlogin.aspx.cs
字號(hào):
?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.OleDb;
public partial class adlogin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
this.Tbuser.Text = "";
this.Tbpwd.Text = "";
}
}
protected void btnok_Click(object sender, EventArgs e)
{
OleDbConnection con = DB.mycon();
con.Open();
string sql = "select * from UserTable where UserName='"+Tbuser.Text.Trim()+"' and UserPwd='"+Tbpwd.Text.Trim()+"'";
OleDbCommand cmd = new OleDbCommand(sql, con);
OleDbDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
Response.Redirect("index.htm");
}
else
{
this.labmessage.Text = "登錄失敗";
}
}
protected void btncansel_Click(object sender, EventArgs e)
{
Response.Redirect("Default.aspx");
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -