Пример #1
0
        public static XSRF CreateXSRF(string SecurityDateTime = null, string Token = null)
        {
            XSRF item = new XSRF();

            if (SecurityDateTime == null || SecurityDateTime == "")
            {
                item.DateTime = string.Format("{0:ddMMyyHHmmss}", DateTime.Now);
            }
            string Secret = USUsersService.SecretXSRF + item.DateTime + Token;

            item.X_XSRF_TOKEN = USUsersService.GetMD5(Secret);
            return(item);
        }
Пример #2
0
        public static Boolean CheckXSRF(XSRF item)
        {
            Boolean flag = false;

            try
            {
                string Secret       = USUsersService.SecretXSRF + item.DateTime + item.Token;
                string X_XSRF_TOKEN = USUsersService.GetMD5(Secret);
                if (X_XSRF_TOKEN == item.X_XSRF_TOKEN)
                {
                    flag = true;
                }
                return(flag);
            }
            catch
            {
                return(false);
            }
        }