Dim st As New Date(1970,1,1,8,0,0)
Dim Timestamp As Integer = CInt((Date.Now - st).TotalSeconds()) '时间戳
Dim Nonce As Integer = Rand.Next(2000,3000) '生成200到300之间的随机整数
Dim Signature As String
Dim haoma As String ="PhoneNumberSet.0= 8615869553734"
Dim neirong As String ="TemplateParamSet.0=987654"
Dim SecretId="AKIDOYdR4SUtON8qV69cZQ2PO8l9UfsrcyKI"
Dim text1 As String = "POSTsms.tencentcloudapi.com/?Action=SendSms&Language=zh-CN&N&" & haoma & "&Region=&SecretId=&Sign=基伟休闲&SmsSdkAppid=1400517359&TemplateID=947545&" & neirong & "&Timestamp=" & Timestamp & "&Version=2019-07-11"
Dim key1 = ""
Dim byteData = Encoding.utf8.GetBytes(text1)
Dim byteKey = Encoding.utf8.GetBytes(key1)
Dim hmac = new System.Security.Cryptography.HMACSHA1(byteKey)
Dim result = hmac.ComputeHash(byteData)
Dim s = Convert.ToBase64String(result )
Dim ul As String = s
Output.Show(UrlEncode(ul))
Signature = UrlEncode(ul)
Dim hc As New HttpClient("https://sms.tencentcloudapi.com")
hc.C
hc.FormData.Add("Action","SendSms")
hc.FormData.Add("Language","zh-CN")
hc.FormData.Add("Nonce",Nonce)
hc.FormData.Add("SecretId","")
hc.FormData.Add("Region","")
hc.FormData.Add("Sign","基伟休闲")
hc.FormData.Add("PhoneNumberSet.0","+8615869553734")
hc.FormData.Add("SmsSdkAppid","1400517359")
hc.FormData.Add("TemplateID","947545")
hc.FormData.Add("TemplateParamSet.0","987654")
hc.FormData.Add("Timestamp",Timestamp)
hc.FormData.Add("Version","2019-07-11")
hc.FormData.Add("Signature",Signature)
Dim ret As String = hc.getData()
'
Output.Show(ret)