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

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 Login : PageBase
  13. {
  14.     Logins lo = new Logins();
  15.     GetUID ge = new GetUID();
  16.     protected void Page_Load(object sender, EventArgs e)
  17.     {
  18.     }
  19.     protected void login_btn_Click(object sender, EventArgs e)
  20.     {
  21.         if (name_txt.Text.Length == 0) {
  22.             Response.Write("<script>alert('用户名不能为空');</script>");
  23.             name_txt.Focus();
  24.         }
  25.         else if (pass_txt.Text.Length == 0)
  26.         {
  27.             Response.Write("<script>alert('密码不能为空');</script>");
  28.             pass_txt.Focus();
  29.         }
  30.         else
  31.         {
  32.             bool yes = lo.loginuser(name_txt.Text, pass_txt.Text);
  33.             if (yes)
  34.             {
  35.                 Session["Login"] = ge.GetUIDs(name_txt.Text);
  36.                 Session["name"] = name_txt.Text;
  37.                 Response.Redirect("Default.aspx");
  38.             }
  39.             else 
  40.             {
  41.                 Response.Write("<script>alert('登录失败');</script>");
  42.             }
  43.         }
  44.     }
  45. }