频道直达 - 专题 - 新闻 - 技巧 - 组网 - 开发 - 安全 - web编程 - 图像 - 操作系统 - 数据库 - 教育 - 旅游 - 健康 - 时尚 - 驱动 - 软件 - 游戏 - 多媒体 - ERP - 讨论组

InTheHand提供的类操作SMS

来源:pcdog 作者: 出处:巧巧读书 2007-06-04 进入讨论组
访问 http://www.qqread.com/csharp/v315325.html

 由于需要催手机里的短消息(SMS)进行操作,现成的API都不能方便的实现,看到最好用的要数InTheHand这家第三方控件了,真的很方便,但是这个版本是商业版($49),发布的试用版不支持这个类的,够郁闷的。

 其实主要就是利用SmsMessageFolder 这个类,哎,有没有什么好办法可以替代它呢?为什么微软不提供操作SMS的API呢?也许在下个版本中会提供吧,但愿吧!!

 帖段使用SmsMessageFolder 类的代码,如下显示就是备份后再删除的功能,真方便!!

PS:InTheHand这家网站的路径不小心被我暴出来了:

InTheHand提供的类操作SMS(图一)Fatal error: Maximum execution time of 30 seconds exceeded in 
InTheHand提供的类操作SMS(图一)C:Inetpubwwwrootinthehand orumsincludes emplate.php(127) : eval()'d code on line 31


InTheHand提供的类操作SMS(图一)using System; 
InTheHand提供的类操作SMS(图一)using System.Collections.Generic; 
InTheHand提供的类操作SMS(图一)using System.Text; 
InTheHand提供的类操作SMS(图一)using System.IO; 
InTheHand提供的类操作SMS(图一)using InTheHand.WindowsMobile.PocketOutlook; 
InTheHand提供的类操作SMS(图一)
InTheHand提供的类操作SMS(图一)namespace DumpSMS 
InTheHand提供的类操作SMS(图二)InTheHand提供的类操作SMS(图三)......{ 
InTheHand提供的类操作SMS(图四)    class Program 
InTheHand提供的类操作SMS(图五)InTheHand提供的类操作SMS(图六)    ......{ 
InTheHand提供的类操作SMS(图四)        private const string FILE_NAME = "sms.txt"; 
InTheHand提供的类操作SMS(图四)        static void Main(string[] args) 
InTheHand提供的类操作SMS(图五)InTheHand提供的类操作SMS(图六)        ......{ 
InTheHand提供的类操作SMS(图四)            if (!File.Exists(FILE_NAME)) 
InTheHand提供的类操作SMS(图五)InTheHand提供的类操作SMS(图六)            ......{ 
InTheHand提供的类操作SMS(图四)                    OutlookSession outSess = new OutlookSession(); 
InTheHand提供的类操作SMS(图四)                    SmsMessageFolder smsFlr = outSess.SmsAccount.Inbox; 
InTheHand提供的类操作SMS(图四)
InTheHand提供的类操作SMS(图四)                    if (smsFlr.Count > 0) 
InTheHand提供的类操作SMS(图五)InTheHand提供的类操作SMS(图六)                    ......{ 
InTheHand提供的类操作SMS(图四)                        // Only save the first sms found 
InTheHand提供的类操作SMS(图四)                        SmsMessage smsMsg = smsFlr[0]; 
InTheHand提供的类操作SMS(图四)                        if (smsMsg.Body.Length > 0) 
InTheHand提供的类操作SMS(图五)InTheHand提供的类操作SMS(图六)                        ......{ 
InTheHand提供的类操作SMS(图四)                            StreamWriter writeStream = File.CreateText(FILE_NAME); 
InTheHand提供的类操作SMS(图四)                            writeStream.WriteLine(smsMsg.Body); 
InTheHand提供的类操作SMS(图四)                            writeStream.Close(); 
InTheHand提供的类操作SMS(图七)                        } 
InTheHand提供的类操作SMS(图四)                        smsMsg.Delete(); 
InTheHand提供的类操作SMS(图四)                                                
InTheHand提供的类操作SMS(图七)                    } 
InTheHand提供的类操作SMS(图四)                    
InTheHand提供的类操作SMS(图七)            } 
InTheHand提供的类操作SMS(图四)
InTheHand提供的类操作SMS(图七)        } 
InTheHand提供的类操作SMS(图七)    } 
InTheHand提供的类操作SMS(图八)}
进入讨论组讨论。
收藏此文】【 】【打印】【关闭
相关图文阅读
频道图文推荐
健 康 咨 询
时 尚 咨 询
巧巧读书宗旨
相关专题
讨论组问题推荐
站内各频道最新更新文档
站内最新制作专题
热门关键字导读
Photoshop教 程照片处理 照片制作 PS快捷键 抠图
计 算 机 故 障XP系统修复
艺 术 与 设 计设计 流媒体 设计欣赏 边框
计 算 机 安 全ARP
站内频道文章精选
巧巧电脑频道编辑信箱  告诉我们您想看的专题或文章