예제 #1
0
        private string _url  = "http://www.7980mt.com/smsCode/getCode";//这里请替换为您的状态监控页

        public SendSMSVC_API(string app_id, string app_secret, string access_token, string numTo, int?exptime)
        {
            APP_ID       = app_id;
            APP_SECRET   = app_secret;
            Access_Token = access_token;
            Method       = RequestType.post;
            SMSVCToken_API smsvctoken_api = new SMSVCToken_API(app_id, app_secret, access_token);
            string         result         = smsvctoken_api.Result;

            try
            {
                JObject jo = JObject.Parse(result);
                _token      = jo.Values("token").ToString();
                _phoneNumTo = numTo;
                if (exptime != null)
                {
                    _exptime = exptime;
                }
                _timestamp = Utility.GetCurrentDate();
                PrepareParam();
            }
            catch (Exception e) {
                throw e;
            }
        }
예제 #2
0
        private string _url = "http://www.7980mt.com/smsCode/getCode"; //这里请替换为您的状态监控页

        #endregion Fields

        #region Constructors

        public SendSMSVC_API(string app_id,string app_secret,string access_token,string numTo, int? exptime)
        {
            APP_ID = app_id;
            APP_SECRET = app_secret;
            Access_Token = access_token;
            Method = RequestType.post;
            SMSVCToken_API smsvctoken_api = new SMSVCToken_API(app_id, app_secret, access_token);
            string result = smsvctoken_api.Result;
            try
            {
                JObject jo = JObject.Parse(result);
                _token = jo.Values("token").ToString();
                _phoneNumTo = numTo;
                if (exptime != null)
                    _exptime = exptime;
                _timestamp = Utility.GetCurrentDate();
                PrepareParam();
            }
            catch (Exception e) {
                throw e;
            }
        }