简体   繁体   English

如何让我的应用程序监听传入的SMS消息?

[英]How can I get my app to listen for Incoming SMS messages?

I have a windows form App which is written to send and recieve texts, this is implemented by sending a message via .NET Remoting to a Service installed on a server, which has a GSM modem (dongle) connected to it, the service then sends the message through the GSM modem once it has a message from the Client App. 我有一个Windows窗体应用程序,编写该应用程序可以发送和接收文本,这是通过.NET Remoting发送消息到安装在服务器上的服务实现的,该服务已连接了GSM调制解调器(加密狗),然后该服务发送一旦收到来自客户端应用程序的消息,便通过GSM调制解调器发送消息。

Everything's going well so far with regards to sending a text, However we need functionality to enable the reading of incoming text messages; 到目前为止,关于发送文本的一切都很好,但是我们需要能够读取传入的短信的功能。 I'm unsure how to go about writing my code to listen out for incoming texts, and then send them over to my Client App. 我不确定如何编写代码来侦听传入的文本,然后将其发送到我的客户端应用程序。

Could anyone give me some pointers on where to start please? 谁能给我一些从哪里开始的指示? I've tried MSDN Documentation on the TcpClientChannel Classes, but this doesn't prove useful for listening to the COM port or anything like that. 我已经在TcpClientChannel类上尝试了MSDN文档,但这对于侦听COM端口或类似端口并没有帮助。

If you are using the AT command set then I'm afraid your server will have to poll the dongle's SIM for messages at an interval (whatever makes sense). 如果您使用的是AT命令集,那么恐怕您的服务器将必须每隔一段时间(无论有什么意义)轮询加密狗的SIM卡以获取消息。

In terms or notifying the client you can either: 根据条款或通知客户,您可以:

  • follow the same scheme as the server and poll regularly 遵循与服务器相同的方案并定期轮询

-or- -要么-

  • if the remoting connection is open continuously, have the server notify using an event on one of your remoting objects. 如果远程连接连续打开,请让服务器使用您的一个远程对象上的事件进行通知。 The event args for this event can contain all of the new messages. 此事件的事件args可以包含所有新消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Android 上读取传入的 MMS 和 SMS 消息 - How to read incoming MMS and SMS messages on Android 如何在 c# 中收听来自 DLL 的消息 - How can I listen to messages from an DLL in c# 如何在 C# 项目中收听设备的消息 - How can I listen a device's messages in a C# project 如何将我的 xamarin android 应用程序注册为 SMS 助手处理程序? - How can I register my xamarin android app as an SMS Assistant handler? 如何获得用户控件以侦听Winform中另一个控件的事件? - How can I get my user control to listen to another control's event in winform? 如何使用OpenPop获取所有电子邮件,还如何在progressBar上显示检索邮件的进度? - How can I get all my email messages using OpenPop and also show progress of messages retrieving on a progressBar? 如何使端点监听我的Web服务? - How can I make an endpoint listen to my webservice? 如何在我的ViewModel中侦听来自另一个ViewModel的更改? - How can I listen in my ViewModel to changes from another ViewModel? 如何在C#应用程序中限制来自ActiveMQ的消息量? - How can I throttle the amount of messages coming from ActiveMQ in my C# app? 为什么我的 tcplistener 听不到。 当我构建我的应用程序的 setup.exe 文件时? - why my tcplistener can't listen. when i build a setup.exe file of my app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM