TAGS :Viewed: 5 - Published at: a few seconds ago

[ Get info about monitors, keyboards and mice connected to computer ]

Is there an effective method to get product name, manufacturer, some unique ID or something like that of monitors, keyboards and mice connected to computer in c#?

Answer 1


You can use WMI for that, you can find examples here :

http://www.codeproject.com/Articles/7365/Retrieving-Hardware-Information-in-C

Answer 2


For get information about monitor you can use OpenSource Project (https://sourceforge.net/projects/wmimonitor/) is a simple WMI Provider written in C# (.NET 3.5 SP1 is required) to list the Serial Number and Model name of the attached Monitor(s).** or use this code

try
        {
            ManagementObjectSearcher searcher = 
                new ManagementObjectSearcher("root\\CIMV2", 
                "SELECT * FROM Win32_DesktopMonitor"); 

            foreach (ManagementObject queryObj in searcher.Get())
            {
                Console.WriteLine("-----------------------------------");
                Console.WriteLine("Win32_DesktopMonitor instance");
                Console.WriteLine("-----------------------------------");
                Console.WriteLine("Description: {0}", queryObj["Description"]);
            }
        }
        catch (ManagementException e)
        {
            MessageBox.Show("An error occurred while querying for WMI data: " + e.Message);
        }

For get information about mic have a look at the open source .NET Voice Recorder project which uses NAudio.or see this artilce, For get keboard information use this sample