ConnectionProfile.GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) ConnectionProfile.GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) ConnectionProfile.GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) ConnectionProfile.GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) ConnectionProfile.GetNetworkUsageAsync(DateTime, DateTime, DataUsageGranularity, NetworkUsageStates) Method

Definition

Gets a list of the estimated data traffic and connection duration over a specified period of time, for a specific network usage state.

DataUsageGranularity is used to indicate the desired granularity of the returned data and affects the length of the returned list. NetworkUsageStates is used to indicate the desired network usage configuration.

public : IAsyncOperation<IVectorView<NetworkUsage>> GetNetworkUsageAsync(DateTime startTime, DateTime endTime, DataUsageGranularity granularity, NetworkUsageStates states)
IAsyncOperation<IVectorView<NetworkUsage>> GetNetworkUsageAsync(DateTime startTime, DateTime endTime, DataUsageGranularity granularity, NetworkUsageStates states) const;
public IAsyncOperation<IReadOnlyList<NetworkUsage>> GetNetworkUsageAsync(DateTimeOffset startTime, DateTimeOffset endTime, DataUsageGranularity granularity, NetworkUsageStates states)
Public Function GetNetworkUsageAsync(startTime As DateTimeOffset, endTime As DateTimeOffset, granularity As DataUsageGranularity, states As NetworkUsageStates) As IAsyncOperation<IReadOnlyList<NetworkUsage>>(Of IVectorView)
Windows.Networking.Connectivity.ConnectionProfile.getNetworkUsageAsync(startTime, endTime, granularity, states).done( /* Your success and error handlers */ );

Parameters

startTime
DateTimeOffset DateTimeOffset DateTimeOffset

The start time over which to retrieve data. Can be no more than 60 days prior to the current time. If the specified granularity is PerMinute, the start time can be no more than 120 minutes prior to the current time.

endTime
DateTimeOffset DateTimeOffset DateTimeOffset

The end time over which to retrieve data.

granularity
DataUsageGranularity DataUsageGranularity DataUsageGranularity

The desired granularity of the returned usage statistics. Each elements in the list corresponds to the network usage per the specified granularity, e.g., usage per hour.

states
NetworkUsageStates NetworkUsageStates NetworkUsageStates

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

Returns

IAsyncOperation<IReadOnlyList<NetworkUsage>> IAsyncOperation<IReadOnlyList<NetworkUsage>> IAsyncOperation<IReadOnlyList<NetworkUsage>>

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

Remarks

For an example of how these methods are used, see How to retrieve connection usage data for a specific period of time.

See also