Esempio n. 1
0
        /// <summary>
        /// 获取COOKIE
        /// </summary>
        /// <param name="var">变量</param>
        /// <returns>状态</returns>
        private double GETCOOKIE(CVariable var)
        {
            String            cookieName    = m_indicator.getText(var.m_parameters[1]);
            UserCookieService cookieService = DataCenter.UserCookieService;
            UserCookie        cookie        = new UserCookie();

            if (cookieService.getCookie(cookieName, ref cookie) > 0)
            {
                CVariable newVar = new CVariable(m_indicator);
                newVar.m_expression = "'" + cookie.m_value + "'";
                m_indicator.setVariable(var.m_parameters[0], newVar);
                return(1);
            }
            return(0);
        }
Esempio n. 2
0
        /// <summary>
        /// 创建服务
        /// </summary>
        public UserSecurityService()
        {
            UserCookie        cookie        = new UserCookie();
            UserCookieService cookieService = DataCenter.UserCookieService;

            if (cookieService.getCookie("USERSECURITY", ref cookie) > 0)
            {
                try {
                    m_codes = JsonConvert.DeserializeObject <List <UserSecurity> >(cookie.m_value);
                }
                catch (Exception ex) {
                }
                if (m_codes == null)
                {
                    try {
                        m_codes = JsonConvert.DeserializeObject <List <UserSecurity> >(cookie.m_value);
                    }
                    catch (Exception ex) {
                    }
                }
            }
        }