Dim tel As String = e.Form.Controls("TextBox3").Value
Dim msg As String = e.Form.Controls("TextBox1").Value
'定义手机,内容两个变量
Dim zh As String = e.Form.Controls("ComboBox1").Value
Dim mm As String = e.Form.Controls("TextBox2").Value
'定义帐号,密码两个变量
If msg Is Nothing Then '如果内容为空
MessageBox.Show("请输入短信的内容", "提示")
Return '退出
Else '不为空,运行下面代码
For Each r As Row In Tables("短信通知").Rows
If r("接收手机").StartsWith("1") = True And r("接收手机").length = 11 Then '如果是手机号提取字符串到 tel变量中
tel = Tables("短信通知").DataTable.GetValues("接收手机" , "接收手机 Like '1%' and Len(接收手机) = 11")
msg = r("短信内容")
Dim url ,s As String
Dim http As Object
url = "http://service.winic.org:8009/sys_port/gateway/?id="& zh &"&pwd="& mm &"&To=" & tel & "&c&time="
'url = "http://service.winic.org:8009/sys_port/gateway/?id="& dr("帐号") &"&pwd="& dr("密码") &"&To=" & dr("接收手机号")& "&c短信内容") &"&time="
http = CreateObject("MSXML2.XMLHTTP")
http.Open("get", url, False)
http.send()
s = http.responseText
Dim Value As String = Left(s,3)
Dim Result As String
Select Case Value
Case "000"
Result = "发送成功!"
Case "-01"
Result = "当前账号余额不足!"
Case "-02"
Result = "当前用户ID错误!"
Case "-03"
Result = "当前密码错误!"
Case "-04"
Result = "参数不够或参数内容的类型错误!"
Case "-05"
Result = "手机号码格式不对!"
Case "-06"
Result = "短信内容编码不对!"
Case "-07"
Result = "短信内容含有敏感字符!"
Case "-08"
Result = "无接收数据!"
Case "-09"
Result = "系统维护中.."
Case "-10"
Result = "手机号码数量超长!(100个/次)"
Case "-11"
Result = "短信内容超长!(70个字符)"
Case "-12"
Result = "其它错误!"
End Select
r("提示信息")= Replace(Replace(Replace(Replace(Replace(s,Value,Result),"Send","本次发送量"),"Consumption","当次消费金额"),"Tmoney","总余额"),"sid","短信编号")
MessageBox.Show("提示信息 : " & r("提示信息"))
End If
Next
End If