register1.aspx.cs
来自「本套软件适用于各大高校、中小学、幼儿园、培训机构等单位的教学管理软件。」· CS 代码 · 共 52 行
CS
52 行
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;
using jianke;
public partial class Register1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection Conn = DB.creatconnection();
Conn.Open();
int t = Convert.ToInt32(DropDownList1.SelectedValue);
string password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox2.Text, "MD5");
// string a=System.Web.Security.FormsAuthentication.h
if (t == 1)
{
String str = "insert into Users (Users_id,Users_password,Users_class)values('" + TextBox1.Text + "','" + password + "','" + 1 + "')";
SqlCommand com = new SqlCommand(str, Conn);
SqlDataReader dr = com.ExecuteReader();
}
else if (t == 2)
{
String str = "insert into Users (Users_id,Users_password,Users_class)values('" + TextBox1.Text + "','" + password + "','" + 2 + "')";
SqlCommand com = new SqlCommand(str, Conn);
SqlDataReader dr = com.ExecuteReader();
}
else
{
String str = "insert into Users (Users_id,Users_password,Users_class)values('" + TextBox1.Text + "','" + password + "','" + 3 + "')";
SqlCommand com = new SqlCommand(str, Conn);
SqlDataReader dr = com.ExecuteReader();
}
TextBox1.Text = "";
TextBox2.Text = "";
}
protected void Button2_Click(object sender, EventArgs e)
{
this.TextBox1.Text = "";
this.TextBox2.Text = "";
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?