|
|
请使用QQ关联注册PLM之家,学习更多关于内容,更多精彩原创视频供你学习!
您需要 登录 才可以下载或查看,没有账号?注册
x
使用ufun的 UF_ask_system_info,通过结构体可以获取诸多信息,以下代码的输出结果如下:
) @- L: o# [% R1 l+ }) a6 ?8 Z! n6 @# }- |
Date : 2014/01/22 17:28:04
2 d& p! q/ D$ Cmachine_type : GenuineIntel Family 6 Model 10 Stepping 9, Intel(R) Core(TM) i7-3667U CPU @ 2.00GHz0 q( {+ l, G5 v
node_name : Teamcenter10
( e/ Y+ [% W9 ]. g" `os_name : Windows NT (x64)8 |8 V+ H8 S& l; f) X! {
os_version : 6.1 (Server) (Build 7601: Service Pack 1) Terminal
9 F; j4 G7 x4 n- X# g' C+ }5 V( f/ z/ I7 oprogram_name : NX 9.0.0.19
' r" a$ r( ?9 u* y7 F2 w& a0 G6 m' F0 {user_name : Administrator
' \6 }$ A; X& ^" o7 u. l( e C E6 ?; p$ ~3 u1 w' ] m
- static void do_api()0 U6 z, q; R5 e: P9 `3 a$ B
- {
6 q& s; U: h+ r8 c -
, N7 J, N- c3 h! F% I8 l - UF_system_info_t sysinfo;
2 _" Y( K. t4 Z. E5 P( P$ V - UF_ask_system_info(&sysinfo); }1 x: D* j9 q8 E. t
- vector<string> info;
/ p. A) [. e% ~5 W, {$ F7 m - char msg[256+1] = " ";
& w; o& [; x5 {& B: ]/ Q" Z - sprintf(msg,"Date : %s\n",sysinfo.date_buf);9 Z4 s1 ^$ U+ f
- info.push_back(msg);( U! D- ~4 P3 r$ K$ _
- sprintf(msg,"machine_type : %s\n",sysinfo.machine_type);$ c# N2 {+ Z. h# {) o
- info.push_back(msg);, [+ y0 b( M1 j/ ~ m! ^
- sprintf(msg,"node_name : %s\n",sysinfo.node_name);
7 v+ q8 I1 h! b( w( X* t% L - info.push_back(msg);) _8 r* c0 H1 x% L' Y
- sprintf(msg,"os_name : %s\n",sysinfo.os_name);
/ Q/ j1 R1 _; ]7 D( k9 _ - info.push_back(msg);) N$ z5 O& V( I
- sprintf(msg,"os_version : %s\n",sysinfo.os_version);8 H6 w* W$ A( ]8 i0 Q
- info.push_back(msg);4 W3 D4 X) ^0 U6 J2 w. G, \, I, G
- sprintf(msg,"program_name : %s\n",sysinfo.program_name);
3 ], B5 |- [: D1 [+ z - info.push_back(msg);
/ N" u/ W$ Y$ l8 o0 t( x - sprintf(msg,"user_name : %s\n",sysinfo.user_name);
" `2 U3 H. f( l2 e& o0 m - info.push_back(msg);
; J( g j- A* m, S _7 b - UF_free_system_info(&sysinfo);; ]8 o9 p* z& v- [7 E
- // write the information to listing window# z4 _; B6 N j4 |5 Y
- UF_UI_exit_listing_window();0 E9 x3 M# u" ]& {9 l3 B
- UF_UI_open_listing_window();
9 O: {, _0 G* {0 H* N7 L) X% ? - int size = info.size();2 \, Y- g0 o& q9 J
- for (int i=0; i<size; i++)
% ?9 H1 y0 P& e, v$ Y - {
' u, B7 n6 R# q/ c" S - UF_UI_write_listing_window(info[i].c_str());. J" R7 B1 Y0 A0 j
- }& {( [2 J5 E. R4 ]& A" {5 }1 ?
- }
( J& A$ U/ l/ e - <p> </p>
复制代码 0 h P! w! W6 S
|
|