获取硬盘,内存和CPU的oid

//硬盘D盘簇数
int dClusters = 1.3.6.1.2.1.25.2.3.1.5.2

//硬盘D盘已用簇数
int dUse = 1.3.6.1.2.1.25.2.3.1.6.2

//硬盘D盘分配单元
int dCell = 1.3.6.1.2.1.25.2.3.1.4.2

double dSizeCount = (double)dClusters * dCell / 1024 / 1024 / 1024;
double dUseCount = (double)dUse * dCell / 1024 / 1024 / 1024;

 

内存的oid:

double iCount=1.3.6.1.2.1.25.2.2.0

double iCell =1.3.6.1.2.1.25.2.3.1.4.7

double iUse =1.3.6.1.2.1.25.2.3.1.6.7

double iCountGB = iCount / 1024 / 1024;
double iUserGB = iCell * iUse / 1024 / 1024 / 1024;

 

参考博客地址:

http://hongliangpan.iteye.com/blog/226983


http://my.oschina.net/yisenn/blog/14626

posted @ 2012-07-10 17:12  小风。  阅读(502)  评论(0编辑  收藏  举报