天天看點

基于C#開發Windows Mobile應用中短信發送功能

.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的應用,如題下圖

基于C#開發Windows Mobile應用中短信發送功能