Skip to content

Easy to get device information and enable/disable device

License

Notifications You must be signed in to change notification settings

oven425/QSoft.DevCon

Repository files navigation

QSoft.DevCon

Quick start

  1. Get all devices displayname
var alldevices = Guid.Empty.Devices()
        .Select(x => new
        {
            displayname = x.GetDisplayName(),
            description = x.GetDescription()
        });
  1. Get all serial port info
var ports = "Ports".Devices()
        .Where(x => x.GetService() == "Serial")
        .Select(x => new
        {
            portname = x.GetComPortName(),
            instanceid = x.GetInstanceId(),
            locationpaths = x.GetLocationPaths()
        });
  1. Enable/Disable camera, need administrator privileges
"Camera".Devices().Enable();
"Camera".Devices().Disable();
  1. Get all device class name and class guid
var class_guid = Guid.Empty.Devices()
        .GroupBy(x => x.GetClass(), x => x.GetClassGuid());
  1. change friend name
//change camera friend name
foreach (var oo in "Camera".Devices())
{
    var friendname = oo.GetFriendName();
    oo.SetFriendName($"test {friendname}");
}

PS: version 1.x.x.x change to 2.x.x.x

Old(1.x.x.x) New(2.x.x.x)
GetChildren() GetChildrens().FirstOrDefault()
GetInstanceId() GetDeviceInstanceId()
GetDevClass() GetClassGuids()
GetDisplayName() GetFriendName()

PS: Thanks for Simple Device Manager.

About

Easy to get device information and enable/disable device

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published