【我的Rust库】get_local_info 0.1.7发布

大家对我真不错,0.1.6版发布才两天,阅读量已超600。感谢,我的运气真好。

以后会继续带给 Rust爱好者 更多的好东西。

get_local_info是一个获取linux本地信息的Rust三方库,其目标是降低获取本地linux系统信息的难度。支持银河麒麟10、UOS、鸿蒙等国产系统。

项目维护:长期

当前版本:0.1.7

当前功能:

1.网络功能

1.1获取活动网卡信息:网卡,IPv4,IPv6,mac

1.2.获取网络接口信息

2.获取系统版本

Kylin10支持2017及以上版本

Ubuntu支持22.04及以上版本

UOS20支持1020及以上版本

3.进程检测,虚拟机检测,双系统检测

4.信息安全检测

获取天融信反病毒库时间

怎么使用:

执行cargo add get_local_info,然后导入调用接口:

rust 复制代码
extern crate get_local_info;

fn main() {
    println!("{}", get_local_info::get_pc_net_card_name());
    println!("{}", get_local_info::get_pc_ipv4());
    println!("{}", get_local_info::get_pc_ipv6());
    println!("{}", get_local_info::get_pc_mac());
    println!("{:?}", get_local_info::get_pc_net_card_info());
    // osname: ubuntu or uos or kylin
    let osname = "uos";
    println!("{}", get_local_info::get_pc_system_ver(osname));
    //check proccess name
    let pname = "gnome";
    println!("{}", get_local_info::get_pc_system_check_pname(pname));
    // flase is Real machine, true is vm
    println!("Running in VM:{}", get_local_info::get_pc_system_is_vm());
     // true is multi os
    println!("multi os:{}", get_local_info::get_pc_system_is_d_sys());
    // Obtain the update time of the antivirus database
    let antiname = "topsec";
    println!("{}", get_local_info::get_pc_check_antiviruslib(antiname));
}

About the Author

* Liu Qiang in Wuhan, China

* crates: <https://crates.io/crates/get_local_info\>

* github: <https://github.com/daijianshusheng/rs_libGetDeviceInfo\>

* mail: <liulcsy@qq.com>

* Created on 2023.12.28

相关推荐
薛定谔的猫-菜鸟程序员26 分钟前
软件架构设计师开发资料大全(从入门到精通)
后端·python·系统架构·flask·架构设计师
牛马鸡niumasi38 分钟前
【Linux】C语言文件操作
linux
say_fall40 分钟前
【Linux系统编程】Ext 文件系统:磁盘与存储、文件与目录、现代计算机究竟如何寻找文件
linux·运维·服务器·数据库·c++
ZEB110644 分钟前
首届安全应急救援机器人大赛在广州举办 深圳璇玑动力斩获多项冠军
安全·机器人·消防
码流子1 小时前
移动收费怎么做?手持终端+App+收费中心的架构实践
java·开发语言·架构
雪落漂泊1 小时前
C++算法 滑动窗口篇(下)
开发语言·c++
云创智城-yuncitys1 小时前
YunParking 4.0:JDK 17 与 Spring Boot 3.2 的停车云升级
java·开发语言·spring boot
郭小李1 小时前
openFeign入门
java·开发语言·前端
wacsii1 小时前
【Linux进程(一)】Linux 进程初探:操作系统如何管理进程?fork() 为什么返回两次?
linux·运维·服务器
AI+程序员在路上2 小时前
RV1126B 上支持的模型及全流程应用--从CNN及语音到 LLMVLM 与跨平台选型
linux·c语言·人工智能