Partager via


Abort

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Cancels the downloader request and resets properties to their initial state.

downloaderObject.Abort()

Managed Equivalent

Managed programming does not use Downloader. See WebClient.

Remarks

The Abort method cancels the downloader request that has been executed by using the Send method of the Downloader object. In addition, Abort resets the following Downloader properties to their initial state.

Property name

Initial state

DownloadProgress (Downloader)

0

Status

0

StatusText

Empty string

Example

The following JavaScript example shows how to invoke the Abort method:

// Cancel the download with a mouse click.
function onLeftMouseButtonUp(sender, eventArgs)
{
    // Cancel Downloader activity and restore state.
    downloader.abort();
}

Applies To

Downloader

See Also

Reference