I did not find any hidden devices, which are not part of the result list of GetPortNames(). Also there are no additional parameters for GetPortNames().
How to get the list of the existing, but with the hidden serial-ports? (see screenshot, there are hidden entries)
Any hint appreciated.
CODE:
// Print existing COM-Ports
var comPorts = SerialPort.GetPortNames();
Console.WriteLine("Detected COM-Ports:");
if (comPorts.Length == 0)
{
Console.WriteLine(" - NONE -");
}
else
{
foreach (var item in comPorts)
{
Console.WriteLine($" - {item}");
}
}
// new ManagementObjectSearcher("SELECT * FROM Win32_PnPEntity WHERE Caption like '%(COM%'") <<< always empty!
RESULT:
Detected COM-Ports:
- NONE -