怎样确定机器上哪些COM 串口可用<br><br>procedure TForm1.Button1Click(Sender: TObject); <br>var <br>reg : TRegistry; <br>ts : TStrings; <br>i : integer; <br>begin <br>reg := TRegistry.Create; <br>reg.RootKey := HKEY_LOCAL_MACHINE; <br>reg.OpenKey('hardware/devicemap/serialcomm', <br>false); <br>ts := TStringList.Create; <br>reg.GetValueNames(ts); <br>for i := 0 to ts.Count -1 do begin <br>Memo1.Lines.Add(reg.ReadString(ts.Strings)); <br>end; <br>ts.Free; <br>reg.CloseKey; <br>reg.free; <br>end;<br><br>