A toolkit for Storage Device informations. Primarily used for reading S.M.A.R.T. data from storage devices.
Please click on an image to show its full size.
Note that the screenshots may not always represent the latest version of the app.
| Project | .NET Version[s] |
|---|---|
| DiskInfoToolkit This library reads detailed information from various types of storage devices - including NVMe, SSD, HDD and USB drives. It provides a high level API to read device data, SMART attributes, Partitions and other hardware details directly from the system. |
.NET Framework 4.7.2 & 4.8.1 .NET Standard 2.0 .NET 8, 9 and 10 |
| ConsoleOutputTest Example Application to show how some library functionality can be used. |
.NET 8 |
| DiskInfoViewer Visualization of detected storage devices on your system. This supports adding / removing storage devices and updates data. UI is built using Avalonia UI. |
.NET 8 |
For the moment we only support Windows.
We are looking into supporting Linux later on.
You can download the latest release from here.
Feel free to give feedback and contribute to our project !
Pull requests are welcome. Please include as much information as possible.
Integrate the library in your own application
Sample code
static class Program
{
static void Main(string[] args)
{
//You can enable logging and set level, if you need logging output
Logger.Instance.IsEnabled = true;
Logger.Instance.LogLevel = LogLevel.Trace;
//Get all storage devices
var disks = Storage.GetDisks();
//Go through all devices
foreach (var disk in disks)
{
//Output Model of storage device
Console.WriteLine($"Detected storage device '{disk.ProductName}' ('{disk.DisplayName}').");
}
//Register change event
Storage.DevicesChanged += DevicesChanged;
var secondsToWait = 10;
//Wait for specified amount of time and listen to device changes
Console.WriteLine($"Waiting {secondsToWait} seconds for device changes.");
Thread.Sleep(TimeSpan.FromSeconds(secondsToWait));
//Update devices once
foreach (var disk in Storage.CurrentDisks)
{
//Refresh device data and output if there were changes compared to cached data
if (Storage.Refresh(disk))
{
Console.WriteLine($"Refreshed - changes detected: '{disk.ProductName}' ('{disk.DisplayName}')");
}
else
{
Console.WriteLine($"Refreshed - no changes detected: '{disk.ProductName}' ('{disk.DisplayName}')");
}
}
//Unregister change event
Storage.DevicesChanged -= DevicesChanged;
//Save log file to current directory, if you enabled logging output
Logger.Instance.SaveToFile("Log.txt", false);
//All done
Console.WriteLine("Press enter to exit...");
Console.ReadLine();
}
static void DevicesChanged(object sender, StorageDevicesChangedEventArgs e)
{
//Check if there are changes, if not we can ignore this event
if (!e.HasChanges)
{
return;
}
//Simple output of added devices
if (e.Added != null)
{
foreach (var added in e.Added)
{
Console.WriteLine($"Added: '{added.ProductName}' ('{added.DisplayName}')");
}
}
//Simple output of removed devices
if (e.Removed != null)
{
foreach (var removed in e.Removed)
{
Console.WriteLine($"Removed: '{removed.ProductName}' ('{removed.DisplayName}')");
}
}
}
}DiskInfoToolkit is free and open source software licensed under MPL 2.0.
You can use it in private and commercial projects.
Keep in mind that you must include a copy of the license in your project.