ConnectionProfile.GetAttributedNetworkUsageAsync(DateTimeOffset, DateTimeOffset, NetworkUsageStates) Method

Definition

Gets network usage data for each individual application. This method is only supported in a Windows Phone 8.x app.

public:
 virtual IAsyncOperation<IVectorView<AttributedNetworkUsage ^> ^> ^ GetAttributedNetworkUsageAsync(DateTime startTime, DateTime endTime, NetworkUsageStates states) = GetAttributedNetworkUsageAsync;
IAsyncOperation<IVectorView<AttributedNetworkUsage>> GetAttributedNetworkUsageAsync(DateTime startTime, DateTime endTime, NetworkUsageStates 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
DateTimeOffset

The start time of the usage window.

endTime
DateTimeOffset

The end time of the usage window.

states
NetworkUsageStates

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

Returns

IAsyncOperation<IReadOnlyList<AttributedNetworkUsage>>

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 10 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