DataUsage 类

定义

注意

Windows 8.1后,DataUsage 可能会更改或不可用。 请改用 NetworkUsage

表示 ConnectionProfile.GetLocalUsage 方法返回的数据使用情况信息。

public ref class DataUsage sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.Deprecated("DataUsage may be altered or unavailable for releases after Windows 8.1. Instead, use NetworkUsage.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class DataUsage final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Deprecated("DataUsage may be altered or unavailable for releases after Windows 8.1. Instead, use NetworkUsage.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
class DataUsage final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.Deprecated("DataUsage may be altered or unavailable for releases after Windows 8.1. Instead, use NetworkUsage.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class DataUsage
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Deprecated("DataUsage may be altered or unavailable for releases after Windows 8.1. Instead, use NetworkUsage.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public sealed class DataUsage
Public NotInheritable Class DataUsage
继承
Object Platform::Object IInspectable DataUsage
属性

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

有关使用成本数据管理连接的详细信息,请参阅 快速入门:管理按流量计费的网络成本约束

属性

BytesReceived

注意

Windows 8.1后,DataUsage 可能会更改或不可用。 请改用 NetworkUsage

获取一个值,该值指示连接在特定时间段内收到的字节数。

BytesSent

注意

Windows 8.1后,DataUsage 可能会更改或不可用。 请改用 NetworkUsage

获取一个值,该值指示连接在特定时间段内发送的字节数。

适用于

另请参阅