公共类WebForm1 继承System.Web.UI.Page
受保护的子Page_Load(ByVal sender As Object,ByVal e As System.EventArgs)处理Me.Load End Sub
Protected Sub Button1_Click(ByVal sender As Object,ByVal e As EventArgs)处理Button1。单击 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&密码=你的密码&帐号=你的账号") Dim res As Byte()= web.UploadData("http://dc.28intercom/sms.aspx ?action = checkkeyword","POST",d)Dim str_res As String str_res = System.Text.Encoding.GetEncoding("utf-8")。GetString(res) Response。写(str_res) 结束子
受保护的Sub Button2_Click(ByVal sender As Object,ByVal e As EventArgs)处理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&密码=你的密码&帐号=你的账号") Dim res As Byte()= web.UploadData (“http://dc.28inter.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)处理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&密码=你的密码&account =你的账号&content ="+ TextBox3.Text +"&mobile =“+ TextBox2.Text" Dim res As Byte()= web.UploadData(“http://www.etanzhi.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 |