|
程序中的sp是SerialPort类型的对象,在System.IO.Ports命名空间下
//手机号码转换为pdu模式 ttem = ""; if (tl == 11) // 11位转换为13位 for (ti = 0; ti < tl; ti += 2) ttem += rtem + ltem; //每两位颠倒 return ttem; //Unicode解码函数 byte[] resByte = System.Text.UnicodeEncoding.Unicode.GetBytes(smsg); private void SendSMS(string csca,string num, string msg) string pdu, psmsc, pnum, pmsg; length = (msg.Length) * 2; if (length < 16) psmsc = telc(csca).Trim(); sp.WriteLine("AT+CMGF=0/r"); byte[] end = { 0x1a }; |
PDU短信发送编码程序(C# 2.0)[转]
最新推荐文章于 2011-11-01 16:48:00 发布
本文介绍了一种通过串口发送短信的方法,包括手机号码格式转换、消息编码及PDU格式构建等关键技术步骤。
6075

被折叠的 条评论
为什么被折叠?



