zoukankan      html  css  js  c++  java
  • NX二次开发-UFUN获取系统相关信息UF_ask_system_info

     1     NX9+VS2012
     2     
     3     #include <uf.h>
     4 
     5 
     6     UF_initialize();
     7 
     8     UF_system_info_t Info;
     9     UF_ask_system_info(&Info);
    10 
    11     lw->Open();
    12     lw->WriteLine(Info.date_buf);//获取当前日期和时间信息
    13     lw->WriteLine(Info.user_name);//获取用户名
    14     lw->WriteLine(Info.program_name);//获取NX版本
    15     lw->WriteLine(Info.node_name);//获取计算机名
    16     lw->WriteLine(Info.machine_type);//获取电脑硬件信息
    17     lw->WriteLine(Info.os_name);//获取操作系统信息
    18     lw->WriteLine(Info.os_version);//获取操作系统版本
    19 
    20     char msg[256];
    21     sprintf(msg, "%d", Info.physical_memory);//获取计算机上物理内存字节数
    22     lw->WriteLine(msg);
    23     
    24     sprintf(msg, "%d", Info.number_of_bundles);//获取正在使用的软件包数量
    25     lw->WriteLine(msg);
    26 
    27     for (int i = 0; i < Info.number_of_bundles; i++)
    28     {
    29         lw->WriteLine(Info.bundles_used[i]);//获取每个软件包名称
    30     }
    31 
    32     UF_free_system_info(&Info);//释放内存
    33     
    34     UF_terminate();

  • 相关阅读:
    CodeForces 650C Table Compression
    HDU 5632 Rikka with Array [想法题]
    HDU 4352 XHXJ's LIS
    HDU 5634 Rikka with Phi
    HDU 4763 Theme Section
    LightOJ 1342 Aladdin and the Magical Sticks [想法题]
    HDU 4578 Transformation
    POJ 1177 Picture
    HDU 4614 Vases and Flowers
    SPOJ AEROLITE
  • 原文地址:https://www.cnblogs.com/nxopen2018/p/10957155.html
Copyright © 2011-2022 走看看