コード例 #1
0
ファイル: Logon.aspx.cs プロジェクト: wooln/AK47Source
        protected void btnLogOn_Click(object sender, System.EventArgs e)
        {
            //			userName.Value = "luzhiqiang";
            //			userPassword.Value = "000000";
            try
            {
                ExceptionHelper.TrueThrow <ApplicationException>(string.IsNullOrEmpty(userName.Value), "对不起,登录名称不能为空");

                ILogOnUserInfo logonUserInfo = new LogOnUserInfo(userName.Value, userPwdType.SelectedItem.Value, userPassword.Value);

                Session["logonUserInfo"] = logonUserInfo;

                //记录系统登录日志(登录成功)
                SetUserPrincipal(logonUserInfo.UserLogOnName);

                FormsAuthentication.SetAuthCookie(logonUserInfo.UserLogOnName, false);

                GlobalInfo.InitHttpEnv(Request);
                GlobalInfo.InitLogOnUser(logonUserInfo);

                UserDataWrite.InsertUserLog(OGULogDefine.LOGON_APP,
                                            OGULogDefine.LOGON_TYPE_SUCCESS,
                                            "用户“" + logonUserInfo.OuUsers[0].UserDisplayName + "”成功登录!",
                                            logonUserInfo.UserLogOnName);

                SysDataWrite.InsertSysLog("jinshan", "y", "adfadsfasdfasdfasdf");

                string strRequestUrl = Request.QueryString["ReturnUrl"];

                if (strRequestUrl != null)
                {
                    FormsAuthentication.RedirectFromLoginPage(logonUserInfo.UserLogOnName, false);
                }
                else
                {
                    Response.Redirect("OGUAdmin.aspx", false);
                }
            }
            catch (System.Exception ex)
            {
                errorMsg.Visible = true;
                errorMsg.Text    = ex.Message.Replace("\n", "<br>");
            }
        }
コード例 #2
0
 public void InsertSysLog(string userLogonName, string winVer, string ieVer, string hostIP, string hostName, string killInfo, string status, string description)
 {
     SysDataWrite.InsertSysLog(userLogonName, winVer, ieVer, hostIP, hostName, killInfo, status, description);
 }