Dela via


ConnectionProfile.GetAttributedNetworkUsageAsync Method

Definition

Gets network usage data for each individual application.

public:
 virtual IAsyncOperation<IVectorView<AttributedNetworkUsage ^> ^> ^ GetAttributedNetworkUsageAsync(DateTime startTime, DateTime endTime, NetworkUsageStates states) = GetAttributedNetworkUsageAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<IVectorView<AttributedNetworkUsage>> GetAttributedNetworkUsageAsync(DateTime const& startTime, DateTime const& endTime, NetworkUsageStates const& states);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<IReadOnlyList<AttributedNetworkUsage>> GetAttributedNetworkUsageAsync(System.DateTimeOffset startTime, System.DateTimeOffset endTime, NetworkUsageStates states);
function getAttributedNetworkUsageAsync(startTime, endTime, states)
Public Function GetAttributedNetworkUsageAsync (startTime As DateTimeOffset, endTime As DateTimeOffset, states As NetworkUsageStates) As IAsyncOperation(Of IReadOnlyList(Of AttributedNetworkUsage))

Parameters

startTime
DateTime DateTimeOffset

The start time of the usage window.

endTime
DateTime DateTimeOffset

The end time of the usage window.

states
NetworkUsageStates

The state of the connection profile for which usage data should be returned.

Returns

When the method completes, it returns a list of AttributedNetworkUsage objects, which indicate the sent and received values, in bytes, and the total amount of time the app was connected during the corresponding time interval.

Attributes

Windows requirements

App capabilities
networkDataPlanProvisioning

Remarks

Note

Data usage tracking is not supported when an app is run on the emulator under Microsoft Visual Studio 2013 Update 2 instead of an actual device. As a result, the GetAttributedNetworkUsageAsync method in a Windows Phone 8.x app will fail when run on the emulator.

Applies to