public void modems()
{
SelectQuery query = new SelectQuery("Win32_POTSModem");
// Inicializo un buscador para la query
ManagementObjectSearcher searcher = new ManagementObjectSearcher(query);
// Saco los resultados de la búsqueda
foreach (ManagementObject envVar in searcher.Get())
{
Console.WriteLine("Modem -> DeviceID: {0}; Name: {1}; Status: {2}; AttachedTo: {3}\n",
envVar["DeviceID"], envVar["Name"], envVar["Status"], envVar["AttachedTo"]);
}
}