[c++] uf获得CPU信息

[复制链接]
梅雷工具箱发表于 2015-6-25 14:21:47 | 显示全部楼层 |阅读模式
c#获得CPU信息


#include <windows.h>


        /* TODO: Add your application code here */


char jsj_f1[132]="";
char jsj_f2[132]="";
char jsj_f3[132]="";
char jsj_f4[132]="";
char jsj_f5[132]="";
char jsj_f6[132]="";
char jsj_f7[132]="";
char jsj_f8[132]="";
char jsj_f9[132]="";
char jsj_f10[132]="";
char jsj_f11[132]="";
char jsj_f12[132]="";
char jsj_f13[132]="";

SYSTEM_INFO  sysInfo;
OSVERSIONINFOEX osvi;  

osvi.dwOSVersionInfoSize=sizeof(osvi);  
sprintf(jsj_f1,"CPU版本   : %u.%u", osvi.dwMajorVersion, osvi.dwMinorVersion);  
sprintf(jsj_f2,"制造商    : %u", osvi.dwBuildNumber);   
sprintf(jsj_f3,"序列号    : %u.%u", osvi.wServicePackMajor, osvi.wServicePackMinor);


GetSystemInfo(&sysInfo);  
printf("OemId : %u\n", sysInfo.dwOemId);
sprintf(jsj_f4,"处理器架构 : %u", sysInfo.wProcessorArchitecture);
sprintf(jsj_f5,"页面大小 : %u", sysInfo.dwPageSize);  
sprintf(jsj_f6,"应用程序最小地址 : %u", sysInfo.lpMinimumApplicationAddress);  
sprintf(jsj_f7,"应用程序最大地址 : %u", sysInfo.lpMaximumApplicationAddress);  
sprintf(jsj_f8,"处理器掩码 : %u", sysInfo.dwActiveProcessorMask);  
sprintf(jsj_f9,"处理器数量 : %u", sysInfo.dwNumberOfProcessors);  
sprintf(jsj_f10,"处理器类型 : %u", sysInfo.dwProcessorType);  
sprintf(jsj_f11,"虚拟内存分配粒度 : %u", sysInfo.dwAllocationGranularity);  
sprintf(jsj_f12,"处理器级别 : %u", sysInfo.wProcessorLevel);  
sprintf(jsj_f13,"处理器版本 : %u", sysInfo.wProcessorRevision);   

UF_UI_open_listing_window(); //打开窗口
UF_UI_write_listing_window(jsj_f1);
UF_UI_write_listing_window("\n");
UF_UI_write_listing_window(jsj_f2);
UF_UI_write_listing_window("\n");
UF_UI_write_listing_window(jsj_f3);
UF_UI_write_listing_window("\n");

UF_UI_write_listing_window(jsj_f4);
UF_UI_write_listing_window("\n");
UF_UI_write_listing_window(jsj_f5);
UF_UI_write_listing_window("\n");
  UF_UI_write_listing_window(jsj_f6);
UF_UI_write_listing_window("\n");
  UF_UI_write_listing_window(jsj_f7);
UF_UI_write_listing_window("\n");
  UF_UI_write_listing_window(jsj_f8);
UF_UI_write_listing_window("\n");
  UF_UI_write_listing_window(jsj_f9);
UF_UI_write_listing_window("\n");
  UF_UI_write_listing_window(jsj_f10);
UF_UI_write_listing_window("\n");
  UF_UI_write_listing_window(jsj_f11);
UF_UI_write_listing_window("\n");
  UF_UI_write_listing_window(jsj_f12);
UF_UI_write_listing_window("\n");
  UF_UI_write_listing_window(jsj_f13);
UF_UI_write_listing_window("\n");

        /* Terminate the API environment */
_____________________________________________________________________________ _

中磊UG二次开发教程 梅雷著 qq1821117007
学UG就上UG网 http://www.9sug.com/
就上UG网淘宝直营店
您需要登录后才可以回帖 登录 | 注册UG网 用百度帐号登录

本版积分规则