共用方式為


ServiceClient.PurgeMessageQueueAsync(String, CancellationToken) Method

Definition

Removes all cloud-to-device messages from a device's queue. This call is made over HTTP.

public virtual System.Threading.Tasks.Task<Microsoft.Azure.Devices.PurgeMessageQueueResult> PurgeMessageQueueAsync (string deviceId, System.Threading.CancellationToken cancellationToken = default);
abstract member PurgeMessageQueueAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.PurgeMessageQueueResult>
override this.PurgeMessageQueueAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Devices.PurgeMessageQueueResult>
Public Overridable Function PurgeMessageQueueAsync (deviceId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PurgeMessageQueueResult)

Parameters

deviceId
String

The device identifier for the target device.

cancellationToken
CancellationToken

A cancellation token to cancel the operation.

Returns

Applies to