Ejemplo n.º 1
0
    public static CardPasswordAgentUsers GetCurrentUser()
    {
        string Key = (System.Web.HttpContext.Current.Session.SessionID + "").ToLower() + "_CardPasswordAgentUsers";

        // 从 Cookie 中取出 UserID
        HttpCookie cookieUser = HttpContext.Current.Request.Cookies[Key];

        if ((cookieUser == null) || (String.IsNullOrEmpty(cookieUser.Value)))
        {
            return(null);
        }

        string CookieUserID = cookieUser.Value;

        try
        {
            CookieUserID = Shove._Security.Encrypt.UnEncryptString(PF.GetCallCert(), Shove._Security.Encrypt.Decrypt3DES(PF.GetCallCert(), CookieUserID, PF.DesKey));
        }
        catch
        {
            CookieUserID = "";
        }

        if (String.IsNullOrEmpty(CookieUserID))
        {
            return(null);
        }

        int UserID = Shove._Convert.StrToInt(CookieUserID, -1);

        if (UserID < 1)
        {
            return(null);
        }

        CardPasswordAgentUsers cardPasswordUsers = new CardPasswordAgentUsers();

        cardPasswordUsers.ID = UserID;

        string ReturnDescription = "";
        int    Result            = cardPasswordUsers.GetInformationByID(ref ReturnDescription);

        if (Result < 0)
        {
            return(null);
        }

        return(cardPasswordUsers);
    }
    public static CardPasswordAgentUsers GetCurrentUser()
    {
        // This item is obfuscated and can not be translated.
        if (HttpContext.Current.Session.SessionID == null)
        {
            return(null);
        }
        string     str    = HttpContext.Current.Session.SessionID.ToLower() + "_CardPasswordAgentUsers";
        HttpCookie cookie = HttpContext.Current.Request.Cookies[str];

        if ((cookie == null) || string.IsNullOrEmpty(cookie.Value))
        {
            return(null);
        }
        string input = cookie.Value;

        try
        {
            input = Encrypt.UnEncryptString(PF.GetCallCert(), Encrypt.Decrypt3DES(PF.GetCallCert(), input, PF.DesKey));
        }
        catch
        {
            input = "";
        }
        if (string.IsNullOrEmpty(input))
        {
            return(null);
        }
        int num = _Convert.StrToInt(input, -1);

        if (num < 1)
        {
            return(null);
        }
        CardPasswordAgentUsers users = new CardPasswordAgentUsers
        {
            ID = num
        };
        string returnDescription = "";

        if (users.GetInformationByID(ref returnDescription) < 0)
        {
            return(null);
        }
        return(users);
    }
 public static CardPasswordAgentUsers GetCurrentUser()
 {
     // This item is obfuscated and can not be translated.
     if (HttpContext.Current.Session.SessionID == null)
     {
         return null;
     }
     string str = HttpContext.Current.Session.SessionID.ToLower() + "_CardPasswordAgentUsers";
     HttpCookie cookie = HttpContext.Current.Request.Cookies[str];
     if ((cookie == null) || string.IsNullOrEmpty(cookie.Value))
     {
         return null;
     }
     string input = cookie.Value;
     try
     {
         input = Encrypt.UnEncryptString(PF.GetCallCert(), Encrypt.Decrypt3DES(PF.GetCallCert(), input, PF.DesKey));
     }
     catch
     {
         input = "";
     }
     if (string.IsNullOrEmpty(input))
     {
         return null;
     }
     int num = _Convert.StrToInt(input, -1);
     if (num < 1)
     {
         return null;
     }
     CardPasswordAgentUsers users = new CardPasswordAgentUsers
     {
         ID = num
     };
     string returnDescription = "";
     if (users.GetInformationByID(ref returnDescription) < 0)
     {
         return null;
     }
     return users;
 }
Ejemplo n.º 4
0
    public static CardPasswordAgentUsers GetCurrentUser()
    {
        string Key = (System.Web.HttpContext.Current.Session.SessionID + "").ToLower() + "_CardPasswordAgentUsers";

        // 从 Cookie 中取出 UserID
        HttpCookie cookieUser = HttpContext.Current.Request.Cookies[Key];

        if ((cookieUser == null) || (String.IsNullOrEmpty(cookieUser.Value)))
        {
            return null;
        }

        string CookieUserID = cookieUser.Value;

        try
        {
            CookieUserID = Shove._Security.Encrypt.UnEncryptString(PF.GetCallCert(), Shove._Security.Encrypt.Decrypt3DES(PF.GetCallCert(), CookieUserID, PF.DesKey));
        }
        catch
        {
            CookieUserID = "";
        }

        if (String.IsNullOrEmpty(CookieUserID))
        {
            return null;
        }

        int UserID = Shove._Convert.StrToInt(CookieUserID, -1);

        if (UserID < 1)
        {
            return null;
        }

        CardPasswordAgentUsers cardPasswordUsers = new CardPasswordAgentUsers();

        cardPasswordUsers.ID = UserID;

        string ReturnDescription = "";
        int Result = cardPasswordUsers.GetInformationByID(ref ReturnDescription);

        if (Result < 0)
        {
            return null;
        }

        return cardPasswordUsers;
    }