如何获得CPU使用率 [英] How to get the CPU usage

查看:109
本文介绍了如何获得CPU使用率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我目前的项目中,我需要获得CPU利用率。

例如,我将拥有服务器的IP,用户名和密码。我将使用我的应用程序中的c#ping该服务器,它将提供CPU使用率。服务器将在同一网络下。



是否有可能获得CPU使用率?



我尝试了什么:



直到现在,当我ping IP地址时,它正在响应服务器是否关闭。

In my current project, I need to get CPU utilization.
Example, I will have the IP, username and password of the server. I will ping that server using c# from my application and it will give CPU usage. The server will be under the same network.

Is it possible to get CPU usage?

What I have tried:

Till now, when I ping the IP address it is responding the server is turned off or not.

推荐答案

PING就是这样:你在吗? - 你可以从中获得的所有信息都是往返旅行的时间,这给了我还活着!信号 - 没有传输其他信息。



我不确定你是否可以获得远程计算机的CPU统计数据而无需编写在服务器上运行的应用程序,当应用程序响应时请求。
PING is just that: "are you there?" - and all the information you can get from it is a time for the round trip, which gives an "I'm alive!" signal - no other information is transferred.

I'm not sure you can get the remote computer's CPU stats without writing an app running on the server which responds to you when requested.


Google for获取远程cpu使用C# [ ^ ]并开始阅读。
Google for "get remote cpu usage C#[^]" and start reading.


IF 您可以从中访问此信息计算机上的计算机管理应用程序;你应该能够使用 PerformanceCounter 类来访问它。
IF you can access this information from the Computer Management Application on your computer; you should be able to access it using the PerformanceCounter class.


这篇关于如何获得CPU使用率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆