Public Class WebForm1
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
Dim web As New System.Net.WebClient() '验证帐号
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim d As Byte() = System.Text.Encoding.UTF8.GetBytes("userid=你的ID&password=你的密码&account=你的账号")
Dim res As Byte() = web.UploadData("http://sms.kingtto.com:9999/sms.aspx?action=checkkeyword", "POST", d)
Dim str_res As String
str_res = System.Text.Encoding.GetEncoding("utf-8").GetString(res)
Response.Write(str_res)
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
Dim web As New System.Net.WebClient() '余额查询
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim d As Byte() = System.Text.Encoding.UTF8.GetBytes("userid=你的ID&password=你的密码&account=你的账号")
Dim res As Byte() = web.UploadData("http://www.qf106.com/sms.aspx?action=overage", "POST", d)
Dim str_res As String
str_res = System.Text.Encoding.GetEncoding("utf-8").GetString(res)
Response.Write(str_res)
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click
Dim web As New System.Net.WebClient() '发送短信
web.Headers.Add("Content-Type", "application/x-www-form-urlencoded")
Dim d As Byte()
d = System.Text.Encoding.UTF8.GetBytes("userid=你的ID&password=你的密码&account=你的账号&content=" + TextBox3.Text + "&mobile=" + TextBox2.Text)
Dim res As Byte() = web.UploadData("http://www.qf106.com/sms.aspx?action=send", "POST", d)
Dim str_res As String
str_res = System.Text.Encoding.GetEncoding("utf-8").GetString(res)
Response.Write(str_res)
End Sub
End Class
|