UsbDeviceLib 1.0.0

dotnet add package UsbDeviceLib --version 1.0.0
NuGet\Install-Package UsbDeviceLib -Version 1.0.0
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="UsbDeviceLib" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add UsbDeviceLib --version 1.0.0
#r "nuget: UsbDeviceLib, 1.0.0"
#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.
// 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

MIT

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.