BugFree.MachineInfo
1.2.2026.613-beta1613
This is a prerelease version of BugFree.MachineInfo.
dotnet add package BugFree.MachineInfo --version 1.2.2026.613-beta1613
NuGet\Install-Package BugFree.MachineInfo -Version 1.2.2026.613-beta1613
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="BugFree.MachineInfo" Version="1.2.2026.613-beta1613" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="BugFree.MachineInfo" Version="1.2.2026.613-beta1613" />
<PackageReference Include="BugFree.MachineInfo" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add BugFree.MachineInfo --version 1.2.2026.613-beta1613
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BugFree.MachineInfo, 1.2.2026.613-beta1613"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package BugFree.MachineInfo@1.2.2026.613-beta1613
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=BugFree.MachineInfo&version=1.2.2026.613-beta1613&prerelease
#tool nuget:?package=BugFree.MachineInfo&version=1.2.2026.613-beta1613&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
BugFree.MachineInfo
跨平台系统信息获取库,支持 Windows/Linux/macOS/FreeBSD。
功能特性
- 硬件信息:CPU、内存、磁盘、显卡、主板、BIOS 等
- 系统信息:操作系统版本、启动时间、进程统计等
- 设备信息:网络适配器、显示器、键盘、鼠标、打印机等
- 运行时监控:CPU 使用率、内存占用、磁盘 I/O、网络速度等
- 应用查询:已安装应用列表、进程查询(支持分页过滤)
安装
dotnet add package BugFree.SystemInfo
快速开始
using BugFree.MachineInfo;
// 初始化(同步)
Machine.Register();
// 或异步初始化
await Machine.RegisterAsync();
// 获取信息
var machine = Machine.Current;
// CPU 信息
foreach (var cpu in machine.Cpus)
{
Console.WriteLine($"CPU: {cpu.Info.Name}");
Console.WriteLine($"核心数: {cpu.Info.NumberOfCores}");
Console.WriteLine($"使用率: {cpu.Runtime.UsagePercentage}%");
}
// 内存信息
Console.WriteLine($"总内存: {machine.Memory?.Info.TotalPhysical / 1024 / 1024 / 1024} GB");
Console.WriteLine($"可用内存: {machine.Memory?.Runtime.AvailablePhysical / 1024 / 1024 / 1024} GB");
// 刷新运行时数据
Machine.Refresh();
// 或异步刷新
await Machine.RefreshAsync();
// 只刷新特定类型
Machine.Refresh(ProviderType.Cpu);
支持的信息类型
| 类型 | 说明 | 静态/动态 |
|---|---|---|
Computer |
计算机基础信息 | 静态 |
Bios |
BIOS 信息 | 静态 |
Motherboard |
主板信息 | 静态 |
Os |
操作系统信息 | 混合 |
Cpus |
CPU 信息 | 混合 |
Memory |
内存信息 | 混合 |
Batteries |
电池信息 | 混合 |
Disks |
物理磁盘 | 混合 |
Drives |
逻辑驱动器 | 混合 |
VideoControllers |
显卡 | 混合 |
NetworkAdapters |
网络适配器 | 混合 |
Monitors |
显示器 | 静态 |
Keyboards |
键盘 | 静态 |
Mice |
鼠标 | 静态 |
SoundDevices |
声卡 | 静态 |
Printers |
打印机 | 静态 |
平台支持
| 平台 | 状态 |
|---|---|
| Windows | ✅ 完全支持 |
| Linux | ✅ 基本支持 |
| macOS | ✅ 基本支持 |
| FreeBSD | ✅ 基本支持 |
示例项目
参考 BugFree.MachineInfo.Example 项目了解更多用法。
许可证
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- System.Diagnostics.PerformanceCounter (>= 8.0.0)
- WmiLight (>= 7.2.0)
-
net8.0
- System.Diagnostics.PerformanceCounter (>= 8.0.0)
- WmiLight (>= 7.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.2026.613-beta1613 | 71 | 6/13/2026 |