reg.aspx.cs
上传用户:shjujing
上传日期:2022-07-28
资源大小:11244k
文件大小:2k
源码类别:

Email客户端

开发平台:

Visual C++

  1. using System;
  2. using System.Data;
  3. using System.Configuration;
  4. using System.Collections;
  5. using System.Web;
  6. using System.Web.Security;
  7. using System.Web.UI;
  8. using System.Web.UI.WebControls;
  9. using System.Web.UI.WebControls.WebParts;
  10. using System.Web.UI.HtmlControls;
  11. using User;
  12. public partial class reg : PageBase
  13. {
  14.     Reg mereg = new Reg();
  15.     jc jcme = new jc();
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.     }
  19.     protected void valiuserbtn_Click(object sender, EventArgs e)
  20.     {
  21.         if (user_txt.Text.Length == 0)
  22.         {
  23.             Response.Write("<script>alert('抱歉,你的用户名是空的');</script>");
  24.         }
  25.         else 
  26.         {
  27.             bool yes = jcme.jcuser(user_txt.Text);
  28.             if (yes)
  29.             {
  30.                 user_txt.Text = "";
  31.                 user_txt.Focus();
  32.                 Response.Write("<script>alert('抱歉,你的用户名已经是存在的了!请更换新的用户名!');</script>");
  33.             }
  34.             else 
  35.             {
  36.                 Response.Write("<script>alert('恭喜,你的用户名字未被使用');</script>");
  37.             }
  38.         }
  39.     }
  40.     protected void yesregbtn_Click(object sender, EventArgs e)
  41.     {
  42.         if (user_txt.Text.Length == 0)
  43.         {
  44.             Response.Write("<script>alert('抱歉,你的用户名是空的');</script>");
  45.         }
  46.         else {
  47.             int x = mereg.RegUser(user_txt.Text, pwd_txt.Text, qrpwd_txt.Text, email_txt.Text);
  48.             if (x != -1)
  49.             {
  50.                 Response.Redirect("Default.aspx");
  51.             }
  52.             else {
  53.                 Response.Write("<script>alert('注册失败');</script>");
  54.             }
  55.         }
  56.     }
  57. }