SmsDevice.FromIdAsync(String) 方法

定义

为接收短信的设备创建 SmsDevice 实例。

public:
 static IAsyncOperation<SmsDevice ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.Deprecated("ISmsDeviceStatics may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Devices.Sms.LegacySmsApiContract)]
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<SmsDevice> FromIdAsync(winrt::hstring const& deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
/// [Windows.Foundation.Metadata.Deprecated("ISmsDeviceStatics may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Devices.Sms.LegacySmsApiContract")]
 static IAsyncOperation<SmsDevice> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.Deprecated("ISmsDeviceStatics may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Devices.Sms.LegacySmsApiContract))]
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<SmsDevice> FromIdAsync(string deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
[Windows.Foundation.Metadata.Deprecated("ISmsDeviceStatics may be altered or unavailable for releases after Windows 10.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Devices.Sms.LegacySmsApiContract")]
public static IAsyncOperation<SmsDevice> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of SmsDevice)

参数

deviceId
String

Platform::String

winrt::hstring

接收短信的 SMS 设备的 DeviceInformation ID 的字符串表示形式。

返回

SMS 设备操作对象。

属性

Windows 要求

应用功能
cellularMessaging sms

注解

SmsReceivedEventDetails 接口处理收到的消息的详细信息;可以将 DeviceInformation ID 从该接口传递到此方法,以激活设备并检索其他消息详细信息,例如发送方和消息正文。 由于设备可能正忙,因此操作以异步方式执行。 异步操作对象立即返回。

适用于