读取串行端口中的传入消息数据 [英] read incoming message data in serial port

查看:66
本文介绍了读取串行端口中的传入消息数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在做一个短信项目,其中来自客户的短信应自动读取并根据收到的短信从数据库中获取数据,并将数据库信息发送到同一手机号.扔短信.
如果消息已接收到串行端口,它将如何自动读取,因此请对此进行帮助.

Hi,
I am doing sms project in which sms coming from customer should read automatically and fetch the data from database as per sms received and send db info to same mobile no. throw sms.
If message has received into the serial port how can it will read automatically so please help me regarding this.

推荐答案

如果您唯一的问题是从串行端口读取(您没有解释自动"是什么意思),则需要使用类System.IO.Ports.SerialPort:
http://msdn.microsoft.com/en-us/library/system. io.ports.serialport.aspx [ ^ ].

最好不要使用异步操作,但所有通信都是单独的线程.

—SA
If your only problem is reading from a serial port (you did not explained what do you mean by "automatically"), you need to use the class System.IO.Ports.SerialPort:
http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx[^].

Better don''t use asynchronous operations but do all the communication is a separate thread.

—SA


这篇关于读取串行端口中的传入消息数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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