Ejemplo n.º 1
0
        /// <summary>
        /// 平台登录
        /// </summary>
        /// <param name="apiId">账号API</param>
        /// <param name="pswd">账号密码</param>
        /// <returns></returns>
        public static bool Login(string apiId, string pswd)
        {
            var       result = string.Empty;
            HttpItems item   = new HttpItems
            {
                URL = $"http://api.ndd001.com/do.php?action=loginIn&name={apiId}&password={pswd}"
            };

            try
            {
                result = new HttpHelpers().GetHtml(item).Html;
#if DEBUG
                Console.WriteLine($"{nameof(Login)} result:{result}");
#endif
            }
            catch (Exception ex)
            {
#if DEBUG
                Console.WriteLine($"{nameof(Login)} ex :{ ex.Message}");
#endif
            }

            if (result.Contains("1|"))
            {
                GlobalToken = result.Replace("1|", "");
                return(true);
            }
            return(false);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 获取手机号
        /// </summary>
        /// <returns>成功返回true,可用CurPhone获取</returns>
        public bool GetPhone()
        {
            var       result = string.Empty;
            HttpItems item   = new HttpItems
            {
                URL = "http://api.ndd001.com/do.php?action=getPhone&sid=" + proJetId + "&token=" + GlobalToken
            };

            try
            {
                result = new HttpHelpers().GetHtml(item).Html;
#if DEBUG
                Console.WriteLine($"{nameof(GetPhone)} result:{result}");
#endif
            }
            catch (Exception ex)
            {
#if DEBUG
                Console.WriteLine($"{nameof(GetPhone)} result:{ex.Message}");
#endif
            }
            if (result.Contains("1|"))
            {
                this.CurPhone = result.Replace("1|", "");
                return(true);
            }
            return(false);
        }
Ejemplo n.º 3
0
        private bool Identity(string cartid, string name, string midA, string midB)
        {
            HttpItems item = new HttpItems
            {
                URL         = "https://pcapi.licai.cn/api/certification/identity",
                Method      = "POST",
                ContentType = "application/x-www-form-urlencoded;",
                Referer     = "https://www.zhaobi.com/",
                UserAgent   = USERAGENT,
                Postdata    = $"country=CN&cardtype=1&cardid={cartid}&name={UrlEncode(name)}&mid={midA}&matchmid={midB}"
            };

            item.Header.Add("Authorization", "Bearer " + _authorization);
            item.Header.Add("FZM-REQUEST-OS", "web");
            item.Header.Add("FZM-USER-IP", this._userIp);
            var result = new HttpHelpers().GetHtml(item).Html;

#if DEBUG
            Console.WriteLine($"{nameof(Identity)} result: {result}");
#endif
            return(result.Contains("message\":\"OK"));
        }