[an error occurred while processing this directive]
[an error occurred while processing this directive]
|
Такой механизм я использую для W2000, w98.
uses Registry;
procedure TForm1.Button1Click(Sender: TObject);
var reg : TRegistry;
ts : TStrings;
i : integer;
begin
reg := TRegistry.Create;
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.OpenKey('hardware\devicemap\serialcomm', false);
ts := TStringList.Create;
reg.GetValueNames(ts);
for i := 0 to ts.Count -1 do
begin
Memo1.Lines.Add(reg.ReadString(ts.Strings[i]));
end;
ts.Free;
reg.CloseKey;
reg.free;
end;
Для определения занятых портов, нужно открывать их по очереди и ловить исключения. Это самое простое.
E-mail: info@telesys.ru