📄 yonghu.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 yonghu : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void ydenglu_Click(object sender, EventArgs e)
{
{
string connString = ConfigurationManager.ConnectionStrings["connectionstring"].ConnectionString;
SqlConnection conn = new SqlConnection(connString);
try
{
conn.Open();
string sql = "SELECT * FROM Card WHERE CardNo='"
+ kahao.Text.Trim() + "' AND UserPwd='"
+ TextBox2.Text.Trim() + "'";
SqlCommand cmd = new SqlCommand(sql, conn);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
//Response.Redirect("User.aspx");
Session["kahao"] = dr["CardNo"].ToString();
FormsAuthentication.RedirectFromLoginPage(kahao.Text, true);
//String CardNo = Server.UrlEncode("");
//Response.Redirect("cailing.aspx?msg=" + CardNo);
//string Url;
//Url = "cailing.aspx?CardNo=" + kahao.Text.Trim();
//Response.Redirect(Url);
//string msg;
//msg = "laixian.aspx?CardNo=" + kahao.Text.Trim();
//Response.Redirect(msg);
}
else
{
Response.Write("<script>alert('卡号或密码错误!')</script>");
}
dr.Close();
}
catch (Exception err)
{
Response.Write("<script>alert(" + err + ")</script>");
}
finally
{
conn.Close();
}
}
}
protected void yquxiao_Click(object sender, EventArgs e)
{
kahao.Text = "";
TextBox2.Text = "";
}
protected void TextBox2_TextChanged(object sender, EventArgs e)
{
}
protected void TextBox1_TextChanged(object sender, EventArgs e)
{
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -