Пример #1
0
 protected void LoginButton_Click(object sender, EventArgs e)
 {
     if (UserName.Text == String.Empty || UserEmail.Text == String.Empty || UserPassOne.Text == String.Empty || UserPhone.Text == String.Empty || UserPhonetele.Text == String.Empty || UserAdress.Text == String.Empty)
     {
         panelAttention.Visible = true;
         lbAttention.Text       = "该字段不可为空!";
     }
     else
     {
         if (user.CheckName(UserName.Text))
         {
             panelAttention.Visible = true;
             lbAttention.Text       = "该用户已经存在!";
         }
         else
         {
             paneInfo.Visible = true;
             lbInfo.Text      = "该用户名可以使用!";
             if (user.InsertUser(UserName.Text, UserPassOne.Text, UserEmail.Text, UserPhone.Text, UserPhonetele.Text, UserAdress.Text, BLL.SEO.GetClientIP()))
             {
                 panelSuccess.Visible = true;
                 lbSuccess.Text       = " 新增用户成功!";
                 UserName.Text        = UserPassOne.Text = UserEmail.Text = UserPhone.Text = UserPhonetele.Text = UserAdress.Text = "";
             }
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string userName = Request.QueryString["userName"].ToString();
         if (userName.Trim() == "")
         {
             Response.Write("<font color='red'>不可为空!</font>");
         }
         else if (user.CheckName(userName))
         {
             Response.Write("<font color='red'>用户名正确!</font>");
         }
         else
         {
             Response.Write("<font color=green>用户名错误!</font>");
         }
     }
 }