获取系统信息可以使用这个函数UF_ask_system_info
下面是例子:
1 extern DllExport void ufsta(char *param, int *returnCode, int rlen) 2 { 3 UF_initialize(); 4 5 UF_system_info_t Ssysinfo; 6 UF_ask_system_info(&Ssysinfo); 7 UF_UI_open_listing_window(); 8 char cListWin[256] = ""; 9 10 sprintf(cListWin, "当前日期 : %s ", Ssysinfo.date_buf); 11 UF_UI_write_listing_window(cListWin); 12 13 sprintf(cListWin, "UG版本 : %s ", Ssysinfo.program_name); 14 UF_UI_write_listing_window(cListWin); 15 16 sprintf(cListWin, "电脑名称 : %s ", Ssysinfo.node_name); 17 UF_UI_write_listing_window(cListWin); 18 19 sprintf(cListWin, "主板信息 : %s ", Ssysinfo.machine_type); 20 UF_UI_write_listing_window(cListWin); 21 22 sprintf(cListWin, "系统版本 : %s ", Ssysinfo.os_name); 23 UF_UI_write_listing_window(cListWin); 24 25 sprintf(cListWin, "处理器 : %s ", Ssysinfo.os_version); 26 UF_UI_write_listing_window(cListWin); 27 28 sprintf(cListWin, "登录名 : %s ", Ssysinfo.user_name); 29 UF_UI_write_listing_window(cListWin); 30 31 UF_free_system_info(&Ssysinfo); 32 33 UF_terminate(); 34 } 35 36 extern int ufusr_ask_unload(void) 37 { 38 return (UF_UNLOAD_IMMEDIATELY); 39 }