串口列表

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
系统里面有哪些串口? get names of available comm ports?
{
Show the names of available comm ports (com1, com2, ...)
Used registry key: hkey_local_machine
}
uses
Registry;
procedure TForm1.Button1Click(Sender: TObject);
var
reg: TRegistry;
st: Tstrings;
i: Integer;
begin
reg := TRegistry.Create;
try
reg.RootKey := HKEY_LOCAL_MACHINE;
reg.OpenKey('hardware', False);
st := TstringList.Create;
try
reg.GetValueNames(st);
for i := 0 to st.Count - 1 do
Memo1.Lines.Add(reg.Readstring(st.strings));
finally
st.Free;
end;
reg.CloseKey;
finally
reg.Free;
end;
end;
 

Similar threads

I
回复
0
查看
435
import
I
I
回复
0
查看
769
import
I
I
回复
0
查看
558
import
I
I
回复
0
查看
584
import
I
后退
顶部