yyangjing

 

//发送验证码

string param = "action=send&userid=****&account=******password=***&content=" + "【签名】+内容+ "&mobile=" 手机号 "&sendtime=";
if (CheckBox1.Checked)//是否定时发送
{
param = param + TextBox4.Text; //
}
else
{
param = param + "";//不需要定时发送,也需要带上""
}
byte[] bs = Encoding.UTF8.GetBytes(param);

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("http://client.movek.net:8888/sms.aspx?"+param);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = bs.Length;

using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(bs, 0, bs.Length);
}
using (WebResponse wr = req.GetResponse())
{
StreamReader sr = new StreamReader(wr.GetResponseStream(), System.Text.Encoding.UTF8);

TextBox3.Text = sr.ReadToEnd().Trim();
}

//查询余额

string param = "userid=****&account=********&password=****&action=overage";
byte[] bs = Encoding.UTF8.GetBytes(param);

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create("http://client.movek.net:8888/sms.aspx?" + param);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = bs.Length;

using (Stream reqStream = req.GetRequestStream())
{
reqStream.Write(bs, 0, bs.Length);
}
using (WebResponse wr = req.GetResponse())
{
StreamReader sr = new StreamReader(wr.GetResponseStream(), System.Text.Encoding.UTF8);

TextBox3.Text = sr.ReadToEnd().Trim();
}

 

分类:

技术点:

相关文章:

  • 2021-11-13
  • 2021-08-18
  • 2021-10-26
  • 2021-11-23
  • 2021-08-18
  • 2021-09-10
猜你喜欢
  • 2021-12-13
  • 2021-10-26
  • 2021-11-15
  • 2021-10-08
  • 2021-11-18
相关资源
相似解决方案