用其他代码替换计时器 [英] replace timer with some other code

查看:79
本文介绍了用其他代码替换计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Visual Basic 2005进行GSM调制解调器的短信接收,但是使用的是事件触发"方法.问题是我是否可以在不使用计时器的情况下实现这一目标?我的意思是我可以使用其他代码替换计时器吗?谢谢:)

解决方案

但是您有什么想法?如果是某种轮询机制,则可以使用计时器或专用线程来监视短信的接收.由于没有实时要求,并且传入的SMS消息的频率将相对较低,因此使用简单的计时器会效率更高.您是否有某些特殊原因想要失去计时器?否则,这是进行一些简单轮询的一种非常易于使用且重量轻的方式.

祝你好运!


我之前尝试过使用计时器接收短信.我想尝试一下我是否可以在不使用计时器的情况下实现相同的结果.我希望它能够自动接收短信,而无需任何按钮等.


i am doing GSM modem receiving of sms using visual basic 2005, but with the method "event triggering". The question is whether i could achieve that without using a timer? I mean is there any way i can replace timer by using some other code? thanks :)

解决方案

But what do you have in mind? If it is some kind of polling mechanism you can either use a timer or a dedicated thread to monitor the receiving of an sms. Since there is no real time requirement and the frequency of incomming sms messages will be relatively low it is much more efficient to use a simple timer. Is there some special reason you want to lose the timer? Otherwise it is a very easy to use and light weight way of doing some simple polling.

Good luck!


i have tried receiving sms with timer before. I want to try whether i can achieve the same result without using a timer. i want it to be able to receive sms automatically without any buttons etc.


这篇关于用其他代码替换计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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