ISmsTextMessage 介面

定義

此介面會操作解碼的 SMS 簡訊。 它可讓您直接存取訊息的純文字本文,以及索引鍵標頭屬性,例如時間戳記。

注意

這項功能僅適用于行動電信業者、行動寬頻介面卡 IHV 或 OEM 提供特殊許可權存取的電信業者和 UWP 應用程式。 如需詳細資訊,請參閱 行動寬頻

注意

在舊版 Windows 中使用舊版傳統型應用程式的維護時,支援這個類別及其方法。 如果您使用這個類別,則必須在應用程式的資訊清單中指定 Windows.Devices.Sms.LegacySmsApiContract 。 如果您要開發適用于 Windows 的新應用程式,請勿使用此類別。 請改用此命名空間中不需要 Windows.Devices.Sms.LegacySmsApiContract的 API。

public interface class ISmsTextMessage : ISmsMessage
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.Sms.LegacySmsApiContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("SmsTextMessage may be altered or unavailable for releases after Windows 10. Instead, use SmsTextMessage2.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Devices.Sms.LegacySmsApiContract)]
/// [Windows.Foundation.Metadata.Guid(3592196172, 42133, 18559, 154, 111, 151, 21, 72, 197, 188, 159)]
struct ISmsTextMessage : ISmsMessage
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.Sms.LegacySmsApiContract, 65536)]
/// [Windows.Foundation.Metadata.Guid(3592196172, 42133, 18559, 154, 111, 151, 21, 72, 197, 188, 159)]
/// [Windows.Foundation.Metadata.Deprecated("SmsTextMessage may be altered or unavailable for releases after Windows 10. Instead, use SmsTextMessage2.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Devices.Sms.LegacySmsApiContract")]
struct ISmsTextMessage : ISmsMessage
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.Sms.LegacySmsApiContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("SmsTextMessage may be altered or unavailable for releases after Windows 10. Instead, use SmsTextMessage2.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Devices.Sms.LegacySmsApiContract))]
[Windows.Foundation.Metadata.Guid(3592196172, 42133, 18559, 154, 111, 151, 21, 72, 197, 188, 159)]
public interface ISmsTextMessage : ISmsMessage
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.Sms.LegacySmsApiContract), 65536)]
[Windows.Foundation.Metadata.Guid(3592196172, 42133, 18559, 154, 111, 151, 21, 72, 197, 188, 159)]
[Windows.Foundation.Metadata.Deprecated("SmsTextMessage may be altered or unavailable for releases after Windows 10. Instead, use SmsTextMessage2.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Devices.Sms.LegacySmsApiContract")]
public interface ISmsTextMessage : ISmsMessage
Public Interface ISmsTextMessage
Implements ISmsMessage
衍生
屬性
實作

Windows 需求

裝置系列
Windows Desktop Extension SDK (已於 10.0.10240.0 引進)
API contract
Windows.Devices.Sms.LegacySmsApiContract (已於 v1.0 引進)
應用程式功能
cellularMessaging sms

備註

介面繼承

ISmsTextMessage 繼承 ISmsMessage。 實作 ISmsTextMessage 的類型也會實作 ISmsMessage的介面成員。

屬性

Body

指定訊息的純文字本文。

Encoding

指定傳送此訊息時已設定為使用的編碼類型。

From

指定郵件寄件者的電話號碼。

Id

擷取訊息的識別碼,稍後可以在呼叫訊息存放區方法中指定,以取得或刪除訊息。

(繼承來源 ISmsMessage)
MessageClass

傳回訊息類別,如操作員的訊息網路所決定。 兩個最常見的類別是 None (一般訊息) 或 Class0 (特殊運算子訊息,例如必須立即向使用者顯示) 的漫遊警告。 使用者訊息的一般用戶端會忽略 Class0 訊息。

(繼承來源 ISmsMessage)
PartCount

如果訊息是多部分訊息的一部分,則擷取原始訊息中的元件總數。

PartNumber

如果此訊息是多部分訊息的一部分,則擷取多部分訊息的元件編號。 它可用來將元件聯結在一起,並搭配 PartReferenceId 和 PartCount 屬性來重新建構原始訊息。

PartReferenceId

指出當訊息是多部分訊息的一部分時,可以使用的參考值。 如果此訊息屬於多部分訊息, 則 PartNumber 值可用來重新建構完整的原始訊息,而該訊息的每個部分都會有 PartReferenceId的相同值。

Timestamp

擷取訊息的時間戳記。 它是針對已建構的訊息實例,或從所接收訊息的服務中心時間戳記,在本機決定。

To

指定此郵件的收件者電話號碼。

方法

ToBinaryMessages(SmsDataFormat)

以指定的格式讀取訊息,並將結果放在二進位訊息的新實例中。

適用於

另請參閱