예제 #1
0
파일: MySms.cs 프로젝트: cnucky/huan
        public string getVcodeAndHoldMobilenum(SmsServer smstype, string phone, string nextpid)
        {
            GetVcodeAndReleaseMobileResp GetVRresp = new GetVcodeAndReleaseMobileResp();
            String result = "";

            try {
                result = send.HttpPost(url,
                                       "action=getVcodeAndHoldMobilenum&uid=" + uid + "&token="
                                       + logonresp.Token + "&mobile=" + phone + "&author_uid="
                                       + author_uid + "&next_pid=" + nextpid);



                String[] reset = result.Split('|');
                if (reset.Length >= 2 && isNumber(reset[0]))
                {
                    GetVRresp.State      = true;
                    GetVRresp.Mobile     = reset[0];
                    GetVRresp.VerifyCode = reset[1];
                    GetVRresp.Result     = result;
                }
                else
                {
                    GetVRresp.State  = false;
                    GetVRresp.Result = result;
                }
            } catch (Exception e1) {
                LogManager.WriteLog(e1.ToString());
            }

            if (GetVRresp.State) //获取到验证码,跳出
            {
                return(GetVRresp.VerifyCode);
                //  break;
            }
            else
            {
                LogManager.WriteLog(GetVRresp.Result);
            }
            return("");
        }
예제 #2
0
파일: MySms.cs 프로젝트: cnucky/huan
        /// <summary>
        /// 获取验证码并不再使用这个手机号
        /// </summary>
        /// <param name="mobile"></param>
        /// <param name="uid"></param>
        /// <param name="token"></param>
        /// <param name="author_uid"></param>
        /// <returns></returns>
        public GetVcodeAndReleaseMobileResp getVcodeAndReleaseMobile(String mobile,
                                                                     String uid, String token, String author_uid)
        {
            GetVcodeAndReleaseMobileResp resp = new GetVcodeAndReleaseMobileResp();
            String result = "";

            try {
                result = send.HttpPost(url,
                                       "action=getVcodeAndReleaseMobile&uid=" + uid + "&token="
                                       + token + "&mobile=" + mobile + "&author_uid="
                                       + author_uid);

                String[] reset = result.Split('|');
                if (reset.Length >= 2 && isNumber(reset[0]))
                {
                    resp.State      = true;
                    resp.Mobile     = reset[0];
                    resp.VerifyCode = reset[1];
                    resp.Result     = result;
                }
                else
                {
                    resp.State  = false;
                    resp.Result = result;
                }

                info(
                    "获取验证码并不再使用这个手机号,mobile:" + mobile + ",uid:"
                    + uid + ",token:" + token + ",author_uid:" + author_uid + ",返回:"
                    + result + ",state:" + resp.State + ",mobile:" + resp.Mobile);
            } catch (Exception e) {
                info(
                    "获取验证码并不再使用这个手机号,mobile:" + mobile + ",uid:"
                    + uid + ",token:" + token + ",author_uid:" + author_uid + ",e:" +
                    e);
                resp.State = false;
            }
            return(resp);
        }