Exemple #1
0
        /// <summary>
        /// 编辑登陆日志内容
        /// </summary>
        /// <param name="log">日志相关信息</param>
        private static string EditLoginLogInfo(LogInfo log)
        {
            StringBuilder sb = new StringBuilder();

            //登录时间
            sb.Append(DateTime.Now.ToString("HH:mm:ss") + ConstUtil.TAB);
            //登录IP
            sb.Append(RequestUtil.GetIP() + ConstUtil.TAB);
            //浏览器类型
            sb.Append(RequestUtil.GetBrowserType() + ConstUtil.TAB);
            //登录类型
            if (LogInfo.LoginLogKind.LOGIN_LOGIN == log.LoginKind)
            {
                sb.Append(ConstUtil.LOG_LOGIN + ConstUtil.TAB);
            }
            else if (LogInfo.LoginLogKind.LOGIN_LOGOUT == log.LoginKind)
            {
                sb.Append(ConstUtil.LOG_LOGOUT + ConstUtil.TAB);
            }
            //登录状态
            if (LogInfo.OperateStatus.SUCCESS == log.Status)
            {
                sb.Append(ConstUtil.LOG_LOGIN_SUCCESS);
            }
            else if (LogInfo.OperateStatus.FAILED == log.Status)
            {
                sb.Append(ConstUtil.LOG_LOGIN_FAILURE);
            }

            sb.Append("\n");
            return(sb.ToString());
        }