如何获取机器的memory和CPU信息?
最近做了一个项目,需要获取机器的CPU和memory的使用情况。花了一些时间网上搜索了一下,自己也做了些测试。总结下来,基本上2种方式:一种是用WMI(2种),另一种是用Performance counter。1. Use WMI to create connection to the computer passing username and password. Once the connection is created, query the CPU& memory by passing the q