For Sending a SMS
you have to purchase the SMS gateway and correspondingly you will get the url for that
Example URL= "http://.xyz/default.aspx/sendSMSusername=???password=????
Dim TempURL As String = URL
For Sending a SMS you have to purchase the SMS gateway and correspondingly you will get the url for that
________________________Code________________________________
Dim useMsg As String
Dim i As Integer
Dim c As String
Try
' Convert characters in the message text
useMsg = ""
For i = 1 To Len(URL)
c = Mid(URL, i, 1)
Select Case c
Case vbCrLf : c = "%0A"
Case vbLf : c = "%0D"
Case " " : c = "%20"
Case "+" : c = "%2B"
Case """" : c = "%22"
Case "#" : c = "%23"
Case "%" : c = "%25"
Case "&" : c = "%26"
Case "," : c = "%2C"
Case "." : c = "%2E"
Case "/" : c = "%2F"
Case ":" : c = "%3A"
Case ";" : c = "%3B"
Case "<" : c = "%3C"
Case "=" : c = "%3D"
Case ">" : c = "%3E"
Case "?" : c = "%3F"
Case "¡" : c = "%A1"
Case "£" : c = "%A3"
Case "#" : c = "%A4"
Case "¥" : c = "%A5"
Case "§" : c = "%A7"
Case "Ä" : c = "%C4"
Case "Å" : c = "%C5"
Case "à" : c = "%E0"
Case "ä" : c = "%E4"
Case "å" : c = "%E5"
Case "Æ" : c = "%C6"
Case "Ç" : c = "%C7"
Case "É" : c = "%C9"
Case "è" : c = "%E8"
Case "é" : c = "%E9"
Case "ì" : c = "%EC"
Case "Ñ" : c = "%D1"
Case "ñ" : c = "%F1"
Case "ò" : c = "%F2"
Case "ö" : c = "%F6"
Case "Ø" : c = "%D8"
Case "Ö" : c = "%D6"
Case "Ü" : c = "%DC"
Case "ù" : c = "%F9"
Case "ü" : c = "%FC"
Case "ß" : c = "%DF"
End Select
useMsg = useMsg + c
Next
Dim Query As String
Dim qLen As Integer
' Construct the HTTP query string
' qLen = Len(Query)
' Request and Response objects
Dim objReq As System.Net.HttpWebRequest
Dim objRes As System.Net.HttpWebResponse
Dim sr As System.IO.StreamReader
Dim sw As System.IO.StreamWriter
Dim ResultantString As String = ""
Dim ret As String = "1"
Dim MAXID As Long
objReq = System.Net.WebRequest.Create(URL)
objReq.Method = "POST"
objReq.ContentType = "application/x-www-form-urlencoded; charset=""utf-8"""
objReq.ContentLength = qLen
sw = New System.IO.StreamWriter(objReq.GetRequestStream())
sw.Write(Query)
sw.Close()
objRes = objReq.GetResponse()
sr = New System.IO.StreamReader(objRes.GetResponseStream())
ret = sr.ReadToEnd()
________________ End Here________________________________
And Finally you can store the responce either in Database or File
Subscribe to:
Post Comments (Atom)
0 comments
Post a Comment