0 out of 2 rated this helpful - Rate this topic

BackgroundTransferRequest Class

April 12, 2014

Represents a background file transfer request.

System.Object
  Microsoft.Phone.BackgroundTransfer.BackgroundTransferRequest

Namespace:  Microsoft.Phone.BackgroundTransfer
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
public sealed class BackgroundTransferRequest : IDisposable

The BackgroundTransferRequest type exposes the following members.

  NameDescription
Public methodBackgroundTransferRequest(Uri)Initializes a new instance of the BackgroundTransferRequest class with the specified request URI.
Public methodBackgroundTransferRequest(Uri, Uri)Initializes a new instance of the BackgroundTransferRequest class with the specified request URI and download file location.
Top
  NameDescription
Public propertyBytesReceivedGets the number of bytes that have been downloaded for the request.
Public propertyBytesSentGets the number of bytes that have been uploaded for the request.
Public propertyDownloadLocationGets or sets the location to which the requested file will be downloaded.
Public propertyHeadersGets the dictionary of HTTP headers for the request.
Public propertyMethodGets or sets the HTTP method for the request.
Public propertyRequestIdGets the unique identifier associated with the request.
Public propertyRequestUriGets the target URI associated with the request.
Public propertyStatusCodeThe HTTP status code of the request
Public propertyTagGets or sets additional data associated with the request.
Public propertyTotalBytesToReceiveGets the total number of bytes that will be downloaded for the request.
Public propertyTotalBytesToSendGets the total number of bytes that will be uploaded for the request.
Public propertyTransferErrorGets the exception associated with a failed background transfer request. A transfer request can have a TransferStatus of Completed whether or not the transfer was completed successfully. If a completed transfer was successful, TransferError will be null.
Public propertyTransferPreferencesGets or sets the preferred conditions under which transfers are enabled.
Public propertyTransferStatusGets the status of the request.
Public propertyUploadLocationGets or sets the location from which the requested file will be uploaded.
Top
  NameDescription
Public methodDisposeReleases all resources used by the current instance of the BackgroundTransferRequest class.
Public methodEquals(BackgroundTransferRequest)Determines whether this BackgroundTransferRequest is equal to the specified object.
Public methodEquals(Object)Determines whether this BackgroundTransferRequest is equal to the specified object. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns the hash code for this instance. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string representation of the BackgroundTransferRequest object. (Overrides Object.ToString().)
Top
  NameDescription
Public eventTransferProgressChangedOccurs when the progress of the transfer changes.
Public eventTransferStatusChangedOccurs when the TransferStatus property of a request changes.
Top

Create a BackgroundTransferRequest object representing a file transfer request and then use the Add method of the BackgroundTransferService class to register the request with the system. Use the Find method to get a BackgroundTransferRequest object representing a transfer request that has already been submitted to obtain status information about the transfer.

For more information on background file transfers, see Background file transfers for Windows Phone 8.

Capabilities

If you use this API in your app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.

ID_CAP_NETWORKING

Windows Phone 8, Windows Phone OS 7.1

For more info, see App capabilities and hardware requirements for Windows Phone 8.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.