StudentRegister.aspx.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class StudentRegister : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack) { }
}
protected void Button1_Click(object sender, EventArgs e)
{
if (username.Value.Trim() == "")
{
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "alert('请输入学号!')", true);
}
else if (password.Value.Trim() == "")
{
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "alert('请输入密码!')", true);
}
else if (PeopleName.Value.Trim() == "")
{
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "alert('请输入姓名!')", true);
}
else if (Mobile.Value.Trim() == "")
{
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "alert('请输入联系电话!')", true);
}
else
{
string xuehao = this.username.Value;
string mima = this.password.Value;
string xingming = this.PeopleName.Value;
string xingbie = this.sex.Items[sex.SelectedIndex].Value;
string nianling = this.Age.Value;
string xueyuan = this.Xueyuan.Value;
string zhuanye = this.Zhuanye.Value;
string jisuanjishuiping = this.jsj.Items[jsj.SelectedIndex].Value;
string yingyudengji = this.yingyu.Items[yingyu.SelectedIndex].Value;
string dianhua = this.Mobile.Value;
string beizhu = this.Intro.Value;
string strsql = "select * from yonghu where xuehao='" + xuehao + "'";//以账号为条件查询用户䯮
sqlConn conn = new sqlConn();
DataSet ds = new DataSet();
ds = conn.hsggetdata(strsql);
if (ds.Tables[0].Rows.Count > 0)//如果存在,代表重复
{
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), System.DateTime.Now.Ticks.ToString(), "alert('学号已存在!')", true);
}
else
{
strsql = "Insert into yonghu(xuehao,mima,xingming,xingbie,nianling,xueyuan,zhuanye,jisuanjishuiping,yingyudengji,dianhua,beizhu,pic)values(";
strsql += "'" + xuehao + "','" + mima + "','" + xingming + "','" + xingbie + "','" + nianling + "','" + xueyuan + "','" + zhuanye + "','" + jisuanjishuiping + "','" + yingyudengji + "','" + dianhua + "','" + beizhu + "','"+HiddenFieldPic.Value+"')";
int result;
后面还有 13 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
