Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello

I need some idea to receive text from sms receiver in .net

I will be receiving sms from some fix mobile number .
A receiver (i dont have it right now)will be attached to my computer by usb.

I have to take these sms and display it on screen

Thank u in advance
Posted

Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...

A very quick search using your subject as the search term gave over four hundred thousand results: Google "receive text from sms receiver in .net"[^]

In future, please try to do at least basic research yourself, and not waste your time or ours.
 
Share this answer
 
Comments
Member 8893861 29-Jul-15 1:32am    
Reply
Sorry for bothering u ppl and thanks for suggestion .
I tried google before posting but it was too confusing as i never did this type of work before
sorry once again
Hi
I think you need to use SMS Gateway hardware. and making communication with a computer via serial port in .net (SerialPort activex in the toolbox).

and send command to serial using ATCommand.

You can try the following example code in vb.net

VB
Dim readBuffer As String
    Private Sub btnConnect_Click(sender As System.Object, e As System.EventArgs) Handles btnConnect.Click

        With SerialPort1

            .ParityReplace = &H3B
            .PortName = "COM1" 'your com serial port
            .BaudRate = 115200
            .Parity = IO.Ports.Parity.None
            .DataBits = 8
            .StopBits = IO.Ports.StopBits.One
            .Handshake = IO.Ports.Handshake.None
            .RtsEnable = False
            .ReceivedBytesThreshold = 1
            .NewLine = vbCr
            .ReadTimeout = 10000

        End With

        Try
            SerialPort1.Open()
        Catch ex As Exception
            MsgBox("Error Open: " & ex.Message)
        End Try

        btnConnect.Enabled = Not SerialPort1.IsOpen
        btnDisconnect.Enabled = SerialPort1.IsOpen
        btnATCommandSend.Enabled = SerialPort1.IsOpen
    End Sub

    Private Sub btnDisconnect_Click(sender As System.Object, e As System.EventArgs) Handles btnDisconnect.Click
        If SerialPort1.IsOpen = True Then
            SerialPort1.DiscardInBuffer()
            SerialPort1.Close()
        End If
        btnConnect.Enabled = Not SerialPort1.IsOpen
        btnDisconnect.Enabled = SerialPort1.IsOpen
        btnATCommandSend.Enabled = SerialPort1.IsOpen
    End Sub

    Private Sub SerialPort1_DataReceived(ByVal sender As System.Object, _
                                        ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) _
                                        Handles SerialPort1.DataReceived

        Try
            readBuffer = SerialPort1.ReadLine()
            Me.Invoke(New EventHandler(AddressOf DoUpdate))

        Catch ex As Exception
            MsgBox("read " & ex.Message)
        End Try

    End Sub

    Private Sub DoUpdate(ByVal sender As Object, ByVal e As System.EventArgs)
        TextBox1.Text = readBuffer
    End Sub

    Private Sub btnATCommandSend_Click(sender As System.Object, e As System.EventArgs) Handles btnATCommandSend.Click
        'AT For read message by index= AT+CMGR=1 'sms index
        'PLEASE REFER ATCOMMAND for more command

        SerialPort1.WriteLine(TextBox2.Text)
    End Sub
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900