如何自动接收传入的短信。 [英] How Do I Recieve Incoming Sms Automatically.

查看:98
本文介绍了如何自动接收传入的短信。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码:

Here's my code:

Private Sub frmRecieveSMS_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Using commPort As IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort("COM8", 9600)
        'display all SMS in my textbox named tbMessages
        commPort.Write("AT+CMGL=""ALL""" & vbCrLf & Chr(34))
        tbMessage.Text = commPort.ReadExisting
    End Using
End Sub





这将显示来自我的SIM卡的所有消息(我猜)。



1.问题是当我收到传入消息时,我的tbMessage.text将如何更新?请帮帮我们! :(



2.我如何获得每条短信并将其放入列表?我不知道如何实施它因为我不知道在哪里停止关于每条短信。谢谢大家:)



我已经死了,我觉得我的脑袋里充满了冲突:(



This will display all messages from my SIM(i guess).

1. the problem is how will my tbMessage.text be updated when i will receive an incoming message? please help guys ! :(

2. How will i get each SMS message and place it in a list? i dont know how to implement it because i don't know where to stop on each SMS message. thanks guys :)

im dying already, i felt my head is bursting :(

推荐答案

你可以使用计时器并输入一些iterval,如20秒

所以代码将每20秒执行一次

你可以检查状态或执行你需要的逻辑! !
you can use timer and put some iterval like 20 seconds
so code will execute every 20 seconds
you can check status or execute what ever logic yout required !!


感谢回复先生,但如果我想每20秒更新一次我的tbMessage只是为了看到新的短信,请不要太长了先生,如果可能的话我想看看发送消息的实时,:))
thanks for the reply sir, but Wouldn't that be too long sir if i want to update my tbMessage every 20 seconds just to see new sms message, if possible i want to see real time who send a message, :)


这篇关于如何自动接收传入的短信。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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