• 大小: 3.62MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-12
  • 语言: 数据库
  • 标签: C#  

资源简介

DOCS 目录存放项目的相关文档 DATA MODEL 目录存放数据库模型和sql脚本

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using VSM.DevFx.SysManage;
using JITE.CIS.framework.Utilities;
namespace JITE.CIS.DevFx.Security
{
    /// 
    /// 用户登录验证模块
    /// 

    public class Authentication
    {
        public Authentication()
        {
            
        }
        /// 
        /// 取得用户角色
        /// 

        /// 
        public static string GetUserRole()
        {
            string Role = ““;
            if (HttpContext.Current.User != null)
            {
                if (HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    if (HttpContext.Current.User.Identity is FormsIdentity)
                    {
                        FormsIdentity id =
                        (FormsIdentity)HttpContext.Current.User.Identity;
                        FormsAuthenticationTicket ticket = id.Ticket;
                        // 取存储在票据中的用户数据,在这里其实就是用户的角色 
                        Role = ticket.UserData;
                    }
                }
            }
            return Role;
        }
        /// 
        /// 
        /// 

        /// 
        public static string GetUserCode()
        {
            string UserCode = ““;
            if (HttpContext.Current.User != null)
            {
                if (HttpContext.Current.User.Identity.IsAuthenticated)
                {
                    if (HttpContext.Current.User.Identity is FormsIdentity)
                    {
                        FormsIdentity id =
                        (FormsIdentity)HttpContext.Current.User.Identity;
                        FormsAuthenticationTicket ticket = id.Ticket;
                        // 取存储在票据中的用户数据,在这里其实就是用户的角色 
                        UserCode = ticket.Name;
                    }
                }
            }
            return UserCode;
        }
        /// 
        /// 验证用户是否经过登录认证
        /// 

        /// 
        public static bool IsAuthenticated()
        {
            return HttpContext.Current.User.Identity.IsAuthenticated;
        }
        /// 
        /// 用户登录
        /// 

        /// 
        /// 
        /// 
        public static bool ValidUser(string userName string password)
        {
            
            if (!string.IsNullOrEmpty(userName) && !string.IsNullOrEmpty(password))
            {
                User _User = new User();
                UserInfo info = _User.Login(userName password);
                //password = FormsAuthentication.HashPasswordForStoringInConfigFile(password “MD5“);
                //string realPassword = Users.GetUser(userName).Password;
                if (info != null)
                {
                    Sessionhelper.Add(“UserInfo“ info);
                    //if(!Gener

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-05-09 09:26  JXNG-master\
     文件         483  2014-05-09 09:26  JXNG-master\.gitattributes
     文件        2643  2014-05-09 09:26  JXNG-master\.gitignore
     目录           0  2014-05-09 09:26  JXNG-master\DOCS\
     文件       10598  2014-05-09 09:26  JXNG-master\DOCS\功能清单.xlsx
     目录           0  2014-05-09 09:26  JXNG-master\Data Model\
     文件        8580  2014-05-09 09:26  JXNG-master\Data Model\JX.sql
     文件     2607104  2014-05-09 09:26  JXNG-master\Data Model\JXNG-DB.eap
     文件       40601  2014-05-09 09:26  JXNG-master\Data Model\JX_FULL_INCLUDE_DATA.sql
     目录           0  2014-05-09 09:26  JXNG-master\JITE.CIS.DevFx.Security\
     文件        5366  2014-05-09 09:26  JXNG-master\JITE.CIS.DevFx.Security\Authentication.cs
     文件        3484  2014-05-09 09:26  JXNG-master\JITE.CIS.DevFx.Security\JITE.CIS.DevFx.Security.csproj
     文件        4318  2014-05-09 09:26  JXNG-master\JITE.CIS.DevFx.Security\NonReduplicatePostModule.cs
     目录           0  2014-05-09 09:26  JXNG-master\JITE.CIS.DevFx.Security\Properties\
     文件        1360  2014-05-09 09:26  JXNG-master\JITE.CIS.DevFx.Security\Properties\AssemblyInfo.cs
     文件        1787  2014-05-09 09:26  JXNG-master\JITE.CIS.DevFx.Security\RecordSysLog.cs
     文件        5195  2014-05-09 09:26  JXNG-master\JITE.CIS.DevFx.Security\UserAuthorizationModule.cs
     目录           0  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\
     文件        7202  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\DatabaseManage.cs
     文件        4576  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\DatabaseProvider.cs
     文件         922  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\DatabaseProviderCollection.cs
     文件        1523  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\DatabaseProviderConfigurationSection.cs
     文件        4762  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\GenericCache.cs
     文件        3909  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\JITE.CIS.framework.DBProviders.csproj
     文件        8668  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\LoggerAttribute.cs
     文件       20003  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\MySQLDatabaseProvider.cs
     文件       20943  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\OLEDatabaseProvider.cs
     文件       21172  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\OracleDatabaseProvider.cs
     目录           0  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\Properties\
     文件        1419  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\Properties\AssemblyInfo.cs
     文件       20758  2014-05-09 09:26  JXNG-master\JITE.CIS.framework.DBProviders\SqlDatabaseProvider.cs
............此处省略915个文件信息

评论

共有 条评论