Ejemplo n.º 1
0
        /// <summary>
        /// 取消一个短信接收,可立即解锁被锁定的金额
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public CancelSMSRecvResp cancelSMSRecvAll(String uid, String token)
        {
            CancelSMSRecvResp resp   = new CancelSMSRecvResp();
            String            result = "";

            try
            {
                result = send.HttpPost(url,
                                       "action=cancelSMSRecvAll&uid=" + uid + "&token=" + token);
                info("取消所有短信接收,可立即解锁所有被锁定的金额,uid:" + uid + ",token:"
                     + token + ",返回:"
                     + result);

                if ("1".Equals(result))
                {
                    resp.State  = true;
                    resp.Flag   = result;
                    resp.Result = result;
                }
                else
                {
                    resp.State  = false;
                    resp.Flag   = result;
                    resp.Result = result;
                }
            }
            catch (Exception e)
            {
                error("取消所有短信接收,可立即解锁所有被锁定的金额,uid:" + uid +
                      ",token:" + token + ",e:" + e);
                resp.State = false;
            }
            return(resp);
        }
Ejemplo n.º 2
0
        /**
         * 释放一个手机号码
         * @param mobile
         */
        private void cancelSMSRecv(String mobile)
        {
            int  retry   = 0;
            bool isretry = false;

            do
            {
                retry++;
                CancelSMSRecvResp resp = AimaInterface.getInstance().cancelSMSRecv(mobile,
                                                                                   uid, token);
                if (!resp.State && ("message|速度过快,请稍后再试".Equals(resp.Result) ||
                                    "message|please try again later".Equals(resp
                                                                            .Result)))
                {
                    isretry = true;
                    try
                    {
                        Thread.Sleep(500);
                    }
                    catch { }
                }
                else
                {
                    isretry = false;
                }
            } while (isretry && retry < 3); //失败重试三次
        }