.NET CF中提供了联系人管理的程序集,并提供了发送短信功能。下为示例代码:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.WindowsMobile.PocketOutlook; //需import该程序集
///
/// 类的定义和函数的定义略
///
OutlookSession outlookSession = new OutlookSession();
string message = “test”;
string phone = “13XXXXXXXXX”;
SmsMessage smsMsg= new SmsMessage(phone, message);
outlookSession.Send(smsMsg);
欲使用该功能,需要首先添加Microsoft.WindowsMobile.PocketOutlook的应用,如题下图