Esempio n. 1
0
        public static Boolean CheckAuthCodeJson(string callType, string authcode)
        {
            Boolean result = false;

            if (authcode.Trim().Length == 0)
            {
                throw new Exception("授权代码不能为空");
            }
            else
            {
                if (!BLCommon.CheckAuthCode(authcode))
                {
                    throw new Exception("授权代码不正确");
                }
            }

            result = true;
            return(result);
        }
Esempio n. 2
0
        public static Boolean CheckAuthCode(string callType, string xmlString, string strType = "xml")
        {
            Boolean result = false;

            if (strType == "xml")
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xmlString);

                XmlNode vNode = doc.SelectSingleNode(callType + "/AuthCode");
                if (vNode == null || vNode.InnerText.Trim().Length == 0)
                {
                    throw new Exception("授权代码不能为空");
                }
                else
                {
                    if (!BLCommon.CheckAuthCode(vNode.InnerText))
                    {
                        throw new Exception("授权代码不正确");
                    }
                }
            }
            else
            {
                JObject obj = JObject.Parse(xmlString);
                if (obj["AuthCode"] == null || obj["AuthCode"].ToString().Length == 0)
                {
                    throw new Exception("授权代码不能为空");
                }
                else
                {
                    if (!BLCommon.CheckAuthCode(obj["AuthCode"].ToString()))
                    {
                        throw new Exception("授权代码不正确");
                    }
                }
            }

            result = true;
            return(result);
        }
Esempio n. 3
0
        private Boolean CheckAuthCode(string callType, string xmlString)
        {
            Boolean     result = false;
            XmlDocument doc    = new XmlDocument();

            doc.LoadXml(xmlString);

            XmlNode vNode = doc.SelectSingleNode(callType + "/AuthCode");

            if (vNode == null || vNode.InnerText.Trim().Length == 0)
            {
                throw new Exception("授权代码不能为空");
            }
            else
            {
                if (!BLCommon.CheckAuthCode(vNode.InnerText))
                {
                    throw new Exception("授权代码不正确");
                }
            }

            result = true;
            return(result);
        }