Click here to Skip to main content
12,829,014 members (37,645 online)
Rate this:
Please Sign up or sign in to vote.
See more: VB VB.NET
anyone can help me to make sms gateway application using (desktop application).....?

please help me.....
Posted 26-Jan-12 2:52am
Updated 1-Feb-12 0:15am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It's a frequent question here in CP, so browse here SMS related questions/answers - Codeproject Search[^]

You can find many articles & past questions with multiple answers, Enjoy.
Espen Harlinn 26-Jan-12 11:01am
Rajesh Anuhya 1-Feb-12 5:18am
+5 for CP, not for Raja ;-)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Imports System.Net
Imports System.Text
Imports System.IO

Module Module1

    Sub Main()

        SendSMS("18479790553", "ToNumber", "I am coming there")

    End Sub
    Sub SendSMS(ByVal FromNumber As String, ByVal ToNumber As String, ByVal SMS As String)

        Dim url As String = ""
        Dim request As HttpWebRequest = DirectCast(WebRequest.Create(url), HttpWebRequest)
        request.Method = "POST"
        Dim postData As String = "FromNumber=" & FromNumber
        postData += "&"
        postData += "ToNumber=" & ToNumber
        postData += "&"
        postData += "SMS=" & SMS
        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
        request.ContentType = "application/x-www-form-urlencoded"
        request.Headers.Add("APIToken", "GoOu9H0h9G")'get your new API token at
        request.ContentLength = byteArray.Length
        Dim dataStream As Stream = request.GetRequestStream()
        dataStream.Write(byteArray, 0, byteArray.Length)
        Dim response As WebResponse = request.GetResponse()
        dataStream = response.GetResponseStream()
        Dim reader As New StreamReader(dataStream)
        Dim responseFromServer As String = reader.ReadToEnd() 'Log This in DB, Queue msgs that failed so that they can be sent again when console app runs
    End Sub

End Module
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

Imports System.Data
Imports System.IO
Imports System.Configuration
Imports System
Imports System.Net
Imports System.Text

Public Function SendSMS(ByVal User As String, ByVal password As String, ByVal Mobile_Number As String, ByVal Message As String, Optional ByVal MType As String = "N") As String
Dim stringpost As String = "User=" & User & "&passwd=" & password & "&mobilenumber=" & Mobile_Number & "&message=" & Message & "&MTYPE=" & MType
Dim functionReturnValue As String = Nothing
functionReturnValue = ""

Dim objWebRequest As HttpWebRequest = Nothing
Dim objWebResponse As HttpWebResponse = Nothing
Dim objStreamWriter As StreamWriter = Nothing
Dim objStreamReader As StreamReader = Nothing

Dim stringResult As String = Nothing

objWebRequest = DirectCast(WebRequest.Create("http://Domain name/WebserviceSMS.aspx"), HttpWebRequest)
//domain name: Domain name Replace With Your Domain
objWebRequest.Method = "POST"

' Response.Write(objWebRequest)

' Use below code if you want to SETUP PROXY.
'Parameters to pass: 1. ProxyAddress 2. Port
'You can find both the parameters in Connection settings of your internet explorer.

' If you are in the proxy then Uncomment below lines and enter IP and Port.
' Dim myProxy As New Net.WebProxy("", 6666)
'myProxy.BypassProxyOnLocal = True
'objWebRequest.Proxy = myProxy

objWebRequest.ContentType = "application/x-www-form-urlencoded"

objStreamWriter = New StreamWriter(objWebRequest.GetRequestStream())

objWebResponse = DirectCast(objWebRequest.GetResponse(),HttpWebResponse)

objWebResponse = DirectCast(objWebRequest.GetResponse(), HttpWebResponse)

objStreamReader = New StreamReader(objWebResponse.GetResponseStream())
stringResult = objStreamReader.ReadToEnd()
Return (stringResult)
Catch ex As Exception
Return (ex.ToString)

If (objStreamWriter IsNot Nothing) Then
End If
If (objStreamReader IsNot Nothing) Then
End If
objWebRequest = Nothing
objWebResponse = Nothing

End Try
End Function

Protected Sub btnsubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
Dim str As String
str = SendSMS(Trim(User1.Value), Passwd.Value, mobilenumber.Value, message.Value)
End Sub
Rate this: bad
Please Sign up or sign in to vote.

Solution 4

Anyone can help me ,I want to make SMS gateway Server (using GSMModem) and its for my school. And I want my App be E-Controlling Software. :) (I'm sorry my English is bad)
CHill60 4-Mar-15 11:10am
If you have a question then use the "Ask a Question" link - don't post questions as solutions to old answers - few people will see it.
However, this is a Quick answers forum so you will have to try something for yourself before posting a question. Use a search engine to do some research and give it a try first... there are plenty of resources here on CodeProject if you type SMS into the search box!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170326.1 | Last Updated 4 Mar 2015
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100