【问题标题】:Does System.Diagnostics.PerformanceCounter not exist in windows 8 metro style app development?Windows 8 Metro 风格应用程序开发中是否不存在 System.Diagnostics.PerformanceCounter?
【发布时间】:2012-08-05 02:48:09
【问题描述】:

我正在尝试显示在 Windows 8 Metro 风格应用程序上使用的 RAM(使用 VS 2012)。

我正在尝试使用以下代码:

PerformanceCounter ramCounter;

我收到一条错误消息,提示 VS 2012 找不到 PerformanceCounter。

System.Diagnositcs 中似乎不存在。如何在 win 8 风格的应用上显示 RAM 或 CPU?

【问题讨论】:

    标签: windows windows-runtime


    【解决方案1】:

    它不会显示在对象浏览器搜索结果中,因此 - WinRT 应用程序不支持它。

    有时您还可以通过文档中的“适用于:桌面应用程序/Metro 风格的应用程序”字符串来判断特定 API,例如 herehere,但我认为这只是如果 API 是 Windows API,则可用。

    大多数 .NET API 不是 Windows API,如果它们在 WinRT 应用程序中不可用 - 它们不会记录在 Windows 文档站点上。 MSDN 不包含这些“适用于”字符串。

    【讨论】:

      猜你喜欢
      • 2012-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多