ConnectionProfile.GetAttributedNetworkUsageAsync 方法

定義

取得每個個別應用程式的網路使用量資料。

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

參數

startTime
DateTime DateTimeOffset

使用時間範圍的開始時間。

endTime
DateTime DateTimeOffset

使用時間範圍的結束時間。

states
NetworkUsageStates

應該傳回使用量資料的連線設定檔狀態。

傳回

當方法完成時,它會傳回 AttributedNetworkUsage 物件的清單,以位元組表示已傳送和接收的值,以及應用程式在對應時間間隔期間連接的總時間量。

屬性

Windows 需求

應用程式功能
networkDataPlanProvisioning

備註

注意

在模擬器上執行應用程式時,不支援資料使用量追蹤Microsoft Visual Studio 2013 Update 2,而不是實際裝置。 因此,在模擬器上執行時,Windows Phone 8.x 應用程式中的 GetAttributedNetworkUsageAsync 方法將會失敗。

適用於