系统信息获取

网络连接信息

win getadaptersInfo获取取网卡详细信息

linux 通过套接字获取

https://www.codeleading.com/article/70412911584/

主机名

win: 调用ntdll.dll获取RtlGetVersion方法、Kernel32.dll获取GetNativeSystemInfo方法。判断主版本号

linux :读取 /etc/redhat-release 、/etc/issue 、/etc/SuSe-release获取,判断是否带桌面,读取/etc/os

-release查看是否含有uos、uniontech os、kylin,并查看uname -a查看含有desktop。

https://blog.csdn.net/qq125096885/article/details/60870846

处理器型号

win 读取注册表 image-20220408164046173

linux 读取/proc/cpuinfo

主板号

win kernel32获取GetSystemFirmwareTable

linux 执行./dmidecode 查看Base Board Informations

获取物理内存

win GlobalMemoryStatusEx

Linux pstat_getstatic获取静态内存页数 、pstat_getdynamic获取动态页数

获取显卡信息

linux ./dmidecode 查看Type:video

win 查询注册表image-20220408165559821

获取内核版本信息

win 调用ntdll.dll获取RtlGetVersion方法

linux uname

获取pcname

linux /etc/sysconfig/network // /etc/hostname

win getcomputerNameA