最近由于要开发短信发送所以有了这个基于AT指令短信发送接收组件,先把dll和Example付上,有空再把代码贴上来,这个组件已在使用中,由于未经严格测试,故此可能会出现bug,还有就是此组件是多线程的,所有如果长期运行可能会导致线程无故死掉,此问题困扰我很久了,还没找到相应的解决办法,只能通过其它程序去检测该程序的运行情况,如果死掉了就重启程序。
如果有需要可从下面的地址获得该组件:
Example:
1
public void smsTest()
2
{
3
//新建一个SMS对象
4
SMS sms = new SMS();
5
//注册接收短信事件
6
sms.ReceiveEvent += new SMSEventHandler(sms_ReceiveEvent);
7
//发送短信
8
sms.Send(new SMSEventArgs("10086", "YE", true));
9
//读取短信
10
string msg = sms.Read(i);
11
//删除一条短信
12
sms.Delete(1);
13
//清空内存中的所有短信
14
sms.Clearn();
15
}
16
17
void sms_ReceiveEvent(object sender, SMSEventArgs e)
18
{
19
Console.WriteLine("********收到新的消息************");
20
Console.WriteLine(e.Message);
21
Console.WriteLine("********收到新的消息结束********");
22
}

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22
