Skip to content

oven425/QSoft.DevCon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QSoft.DevCon

Quick start

  1. Get all devices displayname
var alldevices = Guid.Empty.Devices()
    .Select(x => new
    {
        displayname = x.GetFriendName(),
        description = x.GetDeviceDesc()
    });
  1. Get all serial port info
var ports = "Ports".Devices()
    .Where(x => x.Service() == "Serial")
    .Select(x => new
    {
        portname = x.GetComPortName(),
        instanceid = x.DeviceInstanceId(),
        locationpaths = x.GetLocationPaths()
    });
  1. Get serial port info from Modem
var ffs = "Modem".Devices()
    .Select(x=>new 
    { 
        port = x.GetComPortName(),
        desc = x.GetDeviceDesc(),
    });
  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}");
}
  1. Get device path
var cameras = DevConExtension.KSCATEGORY_VIDEO_CAMERA
    .DevicesFromInterface()
    .Select(x => new
    {
        devicepath = x.DevicePath(),
        friendname = x.As().GetFriendName(),
        panel = x.As().Panel(),
    });
  1. Get device icon
using QSoft.DevCon.WPF;

foreach (var oo in "Camera".Devices())
{
    var icon = oo.GetIcon();
}

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