I am trying to write a program that uses an arduino mega and a FTDI-based USB to RS485 adapter.
I want to make the program user-friendly, thus I don\'t wont the user
as @Marcello Romani pointed out FTDI don't fall into the "serial port" category. Even though I am late I came across this problem recently and I fixed it using another query. Instead of searching in WIN32_SerialPort, you can query the Win32_PnPEntity class.One downside of using this class is that is slow to query.
using (var searcher = new ManagementObjectSearcher
("SELECT * FROM Win32_PnPEntity"))
{
string[] portnames = SerialPort.GetPortNames();
var ports = searcher.Get().Cast().ToList();
foreach (ManagementBaseObject queryObj in ports)
{
}
}