| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- namespace LYFZ.WanYuKeFu
- {
- public partial class Login : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (LYFZ.Command.Command_Session.GetObject("User") != null)
- {
- Response.Redirect(@"~\admin\index.html");
- }
- else
- {
- if (Request.QueryString["login"] != null)
- {
- string name = Request.Form["name"];
- string password = Request.Form["password"];
- LYFZ.WanYuKeFuData.DAL.User userDal = new LYFZ.WanYuKeFuData.DAL.User(Global.DbConn);
- LYFZ.WanYuKeFuData.Model.User retUser = userDal.GetUser(name);
- if (retUser.ID > 0)
- {
- if (LYFZ.WinAPI.SDKSecurity.MD5Encrypt(password).ToLower() == retUser.Password.ToLower())
- {
- LYFZ.Command.Command_Session.AddObject("User", retUser, 600);
- Response.Redirect(@"~\Login.aspx");
- }
- else
- {
- Response.Write("<script type=\"text/javascript\" >alert('用户名或密码不正匹配');window.location.assign(\"/login/index.html\")</script>");
- }
- }
- else
- {
- Response.Write("<script type=\"text/javascript\" >alert('用户名或密码不正确');window.location.assign(\"/login/index.html\")</script>");
- }
- }
- else
- {
- Response.Redirect(@"~\login\index.html");
- }
- }
- }
- }
- }
|