Is there a way to get the COM port number for a device through DeviceInformation
? I can see COM port numbers when I look at them through Device Manager.
I just ran into a couple of devices that don't list the COM port number as part of the Name
property. I plugged two of them in and there's no way to distinguish them from each other. Ideally, I'd like to see a COM port. Is there a different way to get that information?
string _serialSelector = SerialDevice.GetDeviceSelector();
DeviceInformationCollection tempInfo = await DeviceInformation.FindAllAsync(_serialSelector);
if (tempInfo.Count > 0)
{
foreach (var efefe in tempInfo)
{
if (efefe.Kind.Equals(DeviceInformationKind.DeviceInterface))
{
//efefe.Name
}
}
}