public RuPengSMSResult SendSMS(string templateId, string code, string phoneNum) { WebClient wc = new WebClient(); string url = $"http://sms.rupeng.cn/SendSms.ashx?username={Uri.EscapeDataString(UserName)}&appKey={Uri.EscapeDataString(AppKey)}&templateId={templateId}&code={code}&phoneNum={phoneNum}"; wc.Encoding = Encoding.UTF8; string res = wc.DownloadString(url); JavaScriptSerializer jss = new JavaScriptSerializer(); RuPengSMSResult result = jss.Deserialize <RuPengSMSResult>(res); return(result); }
public RuPengSMSResult SendSMS(string templateId, string code, string phoneNum) { WebClient wc = new WebClient(); string url = "http://sms.rupeng.cn/SendSms.ashx?userName="******"&appKey=" + Uri.EscapeDataString(AppKey) + "&templateId=" + Uri.EscapeDataString(templateId) + "&code=" + Uri.EscapeDataString(code) + "&phoneNum=" + Uri.EscapeDataString(phoneNum); wc.Encoding = Encoding.UTF8; string resp = wc.DownloadString(url); JavaScriptSerializer jss = new JavaScriptSerializer(); RuPengSMSResult result = jss.Deserialize <RuPengSMSResult>(resp); return(result); }