다음을 통해 공유


SmsTextMessage 클래스

정의

디코딩된 SMS 문자 메시지를 관리하여 메시지의 일반 텍스트 본문과 타임스탬프를 비롯한 키 헤더 속성에 직접 액세스할 수 있습니다.

참고

이 기능은 모바일 네트워크 운영자, 모바일 광대역 어댑터 IHV 또는 OEM에서 권한 있는 액세스 권한이 부여된 통신사 앱 및 UWP 앱에서만 사용할 수 있습니다. 자세한 내용은 모바일 광대역을 참조하세요.

참고

이 클래스 및 해당 메서드는 이전 버전의 Windows에서 사용한 레거시 데스크톱 앱의 유지 관리를 위해 지원됩니다. 이 클래스를 사용하는 경우 앱 매니페스트에서 Windows.Devices.Sms.LegacySmsApiContract 를 지정해야 합니다. Windows용 새 앱을 개발하는 경우 이 클래스를 사용하지 마세요. 대신 Windows.Devices.Sms.LegacySmsApiContract가 필요하지 않은 이 네임스페이스에서 API를 사용합니다.

public ref class SmsTextMessage sealed : ISmsTextMessage
/// [Windows.Foundation.Metadata.Activatable(65536, Windows.Devices.Sms.LegacySmsApiContract)]
/// [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.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class SmsTextMessage final : ISmsTextMessage
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Devices.Sms.LegacySmsApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Devices.Sms.LegacySmsApiContract")]
/// [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")]
class SmsTextMessage final : ISmsTextMessage
[Windows.Foundation.Metadata.Activatable(65536, typeof(Windows.Devices.Sms.LegacySmsApiContract))]
[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.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class SmsTextMessage : ISmsTextMessage
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Devices.Sms.LegacySmsApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Devices.Sms.LegacySmsApiContract")]
[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 sealed class SmsTextMessage : ISmsTextMessage
function SmsTextMessage()
Public NotInheritable Class SmsTextMessage
Implements ISmsTextMessage
상속
Object Platform::Object IInspectable SmsTextMessage
특성
구현

Windows 요구 사항

디바이스 패밀리
Windows Desktop Extension SDK (10.0.10240.0에서 도입되었습니다.)
API contract
Windows.Devices.Sms.LegacySmsApiContract (v1.0에서 도입되었습니다.)
앱 기능
cellularMessaging sms

생성자

SmsTextMessage()

SmsTextMessage 클래스의 instance 만듭니다.

속성

Body

메시지의 일반 텍스트 본문을 지정합니다.

Encoding

이 메시지를 보낼 때 사용하도록 설정된 인코딩 형식을 지정합니다.

From

메시지 보낸 사람의 전화 번호를 지정합니다.

Id

SMS 문자 메시지의 ID를 나타냅니다.

MessageClass

메시지의 메시지 클래스를 지정합니다. 이 메시지 클래스는 일반적으로 모바일 디바이스가 아닌 네트워크에서 시작됩니다.

PartCount

메시지가 다중 파트 메시지의 일부인 경우 원본 메시지의 총 부분 수를 나타냅니다.

PartNumber

이 메시지가 다중 파트 메시지의 일부인 경우 다중 파트 메시지의 파트 번호를 나타냅니다. PartReferenceIdPartCount 속성과 함께 파트를 함께 조인하여 원래 메시지를 다시 구성하는 데 사용할 수 있습니다.

PartReferenceId

메시지가 다중 파트 메시지의 일부인 경우 사용할 수 있는 참조 값을 나타냅니다. 이 메시지가 여러 부분으로 구성된 메시지에 속하는 경우 PartNumber 값을 사용하여 전체 원본 메시지를 다시 구성할 수 있으며 해당 메시지의 각 부분은 PartReferenceId에 대해 동일한 값을 갖습니다.

Timestamp

메시지의 타임스탬프를 나타냅니다. 생성된 메시지 instance 또는 수신된 메시지의 서비스 센터 타임스탬프에서 로컬로 결정됩니다.

To

이 메시지의 받는 사람 전화 번호를 나타냅니다.

메서드

FromBinaryData(SmsDataFormat, Byte[])

이진 메시지를 디코딩하고 결과를 문자 메시지의 새 instance 배치합니다. 이 메서드는 바이트 버퍼에 대한 참조 및 버퍼가 인코딩되는 방법의 선택 항목으로 이진 메시지를 나타냅니다. 따라서 메시지가 디바이스에서 직접 시작되지 않았거나 SmsBinaryMessage 클래스의 instance 사용할 수 있습니다.

FromBinaryMessage(SmsBinaryMessage)

이진 메시지를 읽고 디코딩합니다. 결과는 문자 메시지의 새 instance 배치됩니다.

ToBinaryMessages(SmsDataFormat)

지정된 형식으로 메시지를 읽고 결과를 이진 메시지의 새 instance 배치합니다.

적용 대상