UsbDeviceLib 1.0.0
dotnet add package UsbDeviceLib --version 1.0.0
NuGet\Install-Package UsbDeviceLib -Version 1.0.0
<PackageReference Include="UsbDeviceLib" Version="1.0.0" />
paket add UsbDeviceLib --version 1.0.0
#r "nuget: UsbDeviceLib, 1.0.0"
// Install UsbDeviceLib as a Cake Addin
#addin nuget:?package=UsbDeviceLib&version=1.0.0
// Install UsbDeviceLib as a Cake Tool
#tool nuget:?package=UsbDeviceLib&version=1.0.0
UsbDeviceLib
UsbDeviceLib is a .NET library designed to facilitate easy and efficient management of USB devices on Windows systems. It provides robust tools to retrieve detailed information about connected USB drives, including device names, storage capacity, file systems, and more.
Features
- Detect USB Drives: Automatically identifies all connected removable USB storage devices.
- Asynchronous Data Retrieval: Fetches data asynchronously, ensuring non-blocking operations in your applications.
- Detailed Information: Extracts detailed information about each device, such as device name, serial number, size, and volume details.
- Data Serialization: Supports converting USB drive data into JSON format for easy integration with other applications or for logging purposes.
Installation
UsbDeviceLib is available as a NuGet package. You can install it using the following methods:
Via .NET CLI
dotnet add package UsbDeviceLib
Usage
Here are some examples of how to use UsbDeviceLib to manage USB devices:
List All Connected USB Devices
var usbDrives = UsbDriveSearcher.GetUsbDrives();
foreach(var drive in usbDrives)
{
Console.WriteLine(drive);
}
Asynchronous Usage
var usbDrives = await UsbDriveSearcher.GetUsbDrivesAsync();
foreach(var drive in usbDrives)
{
Console.WriteLine(drive);
}
Convert USB Drive Information to JSON
string jsonOutput = UsbDriveUtilities.GetUsbDrivesAsJson(usbDrives);
Console.WriteLine(jsonOutput);
Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Contact
Ntanos David-Vasileios - davidvdanos@gmail.com
Project Link: https://github.com/hwarang098tkd/USBDeviceInfoSolution
License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Microsoft.CSharp (>= 4.7.0)
- Newtonsoft.Json (>= 13.0.3)
- System.Data.DataSetExtensions (>= 4.5.0)
- System.Management (>= 8.0.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.0.0 | 57 | 4/18/2024 |
Initial release of UsbDeviceLib.