您目前尚未登陆,请选择【登陆】或【注册
首页->上传下载->文件在线管理系统0.30源码>>Web.Processor/Manage/LoginProcessor.cs>>源码在线查看
温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:文件在线管理系统0.30源码
当前文件:文件类型 FileManager/Web.Processor/Manage/LoginProcessor.cs打开代码结构图
普通视图
		            
1using System; 2using System.Web; 3using System.Web.Security; 4using System.Web.SessionState; 5 6namespace ptw.FileManager.Web.Processor.Manage 7{ 8 /// <summary> 9 /// 登录处理 10 /// </summary> 11 public class LoginProcessor 12 { 13 private string _Value; 14 private bool _LoginState = true; 15 16 /// <summary> 17 /// 处理结果 18 /// </summary> 19 public string Value 20 { 21 get { return _Value; } 22 } 23 24 /// <summary> 25 /// 登录验证是否成功 26 /// </summary> 27 public bool LoginState 28 { 29 get { return _LoginState; } 30 } 31 32 /// <summary> 33 /// 构造方法 34 /// </summary> 35 public LoginProcessor() 36 { 37 HttpRequest Request = HttpContext.Current.Request; 38 HttpSessionState Session = HttpContext.Current.Session; 39 40 string userName = Request.Form["username"]; 41 string passWord = Request.Form["password"]; 42 string code = Request.Form["code"]; 43 44 if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(passWord) || string.IsNullOrEmpty(code)) 45 { 46 this._Value = "请填写完整"; 47 this._LoginState = false; 48 } 49 else if (Session["CheckCode"] == null) 50 { 51 this._Value = "验证码已过期"; 52 this._LoginState = false; 53 } 54 else if (code != Session["CheckCode"].ToString()) 55 { 56 this._Value = "验证码错误"; 57 this._LoginState = false; 58 } 59 60 if (this._LoginState == true) 61 { 62 if (FormsAuthentication.Authenticate(userName, passWord)) 63 { 64 FormsAuthentication.SetAuthCookie(userName, false); 65 } 66 else 67 { 68 this._Value = "身份验证失败"; 69 } 70 } 71 } 72 } 73}
还没有找到您心仪的内容?请用.net源码大搜捕
代码片断 打包下载该项目完整源码:文件在线管理系统0.30源码
51Aspx.com 版权所有 CopyRight © 2000-2008. 京ICP备06046876号