如何在asp.net中发送自动短信或使用sql [英] How to send automatic sms in asp.net or using sql

查看:71
本文介绍了如何在asp.net中发送自动短信或使用sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  我的   birthdate 我想发送自动短信 on  perticular 时间每天,我该如何实现这一点,任何人都可以知道吗? 

感谢 advance。

解决方案

 



Dim dt As New DataTable

CreateDataTable(dt,select * from Table where Id = 1)

If(dt.Rows.Count> 0)然后

Dim request As HttpWebRequest

Dim response As HttpWebResponse =没有什么

Dim url As String

Dim senderid As String = dt.Rows(0).Item(SenderId)。ToString()

Dim password As String = dt.Rows(0).Item(Password)。ToString()

Dim host As String

Dim originator As String = dt。行(0).Item(UserName)。ToString()

尝试

host =http://smsidea.co.in/sendsms.aspx?

'originator =3423434343

'password =234hj

url = host +mobile =& HttpUtility.UrlEncode(创始人)_

& & pass =+ HttpUtility.UrlEncode(密码)_

& & senderid =+ HttpUtility.UrlEncode(senderid)_

& & to =+ HttpUtility.UrlEncode(StrToNumber)_

& & msg =+ HttpUtility.UrlEncode(StrBody)

request = DirectCast(WebRequest.Create(url),HttpWebRequest)

response = DirectCast(request.GetResponse( ),HttpWebResponse)

'MessageBox.Show(Response:& response.StatusDescription)

Catch ex As Exception

结束尝试


In my table there is birthdate column, and i want send auto sms on perticular time daily, How can i implement this, Can anyone know??

Thankx in advance.

解决方案


Dim dt As New DataTable
CreateDataTable(dt, "select * from Table where Id = 1")
If (dt.Rows.Count > 0) Then
Dim request As HttpWebRequest
Dim response As HttpWebResponse = Nothing
Dim url As String
Dim senderid As String = dt.Rows(0).Item("SenderId").ToString()
Dim password As String = dt.Rows(0).Item("Password").ToString()
Dim host As String
Dim originator As String = dt.Rows(0).Item("UserName").ToString()
Try
host = "http://smsidea.co.in/sendsms.aspx?"
'originator = "3423434343"
'password = "234hj"
url = host + "mobile=" & HttpUtility.UrlEncode(originator) _
& "&pass=" + HttpUtility.UrlEncode(password) _
& "&senderid=" + HttpUtility.UrlEncode(senderid) _
& "&to=" + HttpUtility.UrlEncode(StrToNumber) _
& "&msg=" + HttpUtility.UrlEncode(StrBody)
request = DirectCast(WebRequest.Create(url), HttpWebRequest)
response = DirectCast(request.GetResponse(), HttpWebResponse)
'MessageBox.Show("Response: " & response.StatusDescription)
Catch ex As Exception
End Try


这篇关于如何在asp.net中发送自动短信或使用sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆