有没有办法在 asp.net 页面上显示 CPU 和 RAM 使用情况统计信息。我试过 this 代码但我有错误:

Access to the registry key 'Global' is denied.

在这一行:
ramCounter = new PerformanceCounter("Memory", "Available MBytes");

最佳答案

如评论中所述,如果没有适当的权限,您将无法执行此操作。资源统计会包含很多系统其他用户拥有的进程的信息,属于特权信息

关于c# - 如何在asp.net中获取CPU使用率,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5356657/

10-17 03:00