Dim sj As Long'定义生成一个随机数
sj = SmsSenderUtil.getRandom()
Dim hc As New HttpClient(" https://yun.tim.qq.com/v5/tlssmssvr/sendsms?sdkappid=1400294998&random= " & sj) '请求短信接口地址
hc.ContentType = "application/json"
Dim appkey As String="26ccd48b4fc028fce1e4ef0b7723bdcd" '密匙参数
Dim random As Long= sj '随机数参数
Dim time As Long=SmsSenderUtil.getCurrentTime() '时间戳参数
Dim moblile As String ="13589956068" '手机号参数
Dim sig As String = SmsSenderUtil.calculateSignature(appkey , random, time , moblile ) ' sha256算法
Dim params As JArray '接口参数定义
Dim sign As String
Dim nationcode As String
Dim tel As JObject
Dim tpl_id As Integer
Dim jo As New JObject '定义对象
Dim ja As New JArray
ja.Add("123456") '定义数组
jo("params")= ja
jo("sig")=sig
jo("sign")="新动感"
Dim jo1 As New JObject '定义字对象
jo1("mobile")="13589956068"
jo1("nationcode")="86" ''代入注册的参数数值
jo("tel")=jo1
jo("time")=sp '代入生成的时间戳数值
jo("tpl_id")=497632 '代入注册的参数数值
hc.content=jo.ToString()
Dim ret As String = hc.getData()
If hc.rCookies.ContainsKey("error") Then
MessageBox.Show(hc.rCookies("error"), "提示", MessageBoxButtons.OK ,MessageBoxIcon.Warning)
Else
MessageBox.Show( ret)
End If