想写个自动获取串口的程序一直报“AbstractError”的错误
delphi吧
全部回复
仅看楼主
level 10
嘻哈泥鳅 楼主
我在获取主键下各数值名称时报错过不去,比较小白,不太懂问题出在那里,请大神指教一二。O(∩_∩)O谢谢
2017年01月10日 06点01分 1
level 10
嘻哈泥鳅 楼主
procedure TForm1.Button1Click(Sender: TObject);
var
Reg:TRegistry;
NameLst:TStrings;
i:integer;
begin
Reg:= TRegistry.Create;
NameLst:= TStrings.Create;
try
Reg.RootKey:= HKEY_LOCAL_MACHINE;
Reg.OpenKey('HARDWARE\DEVICEMAP\SERIALCOMM',true);
Reg.GetValueNames(NameLst);
self.memo1.Clear;
for i := 0 to NameLst.Count-1 do
memo1.Lines.Add(reg.ReadString(Namelst[i]));
finally
begin
Reg.CloseKey;
Reg.Free;
Namelst.Free;
end;
end;
end;
2017年01月10日 06点01分 2
level 11
你或许需要管理员权限[滑稽],毕竟你在操作注册表,如果我没有看错
2017年01月10日 13点01分 4
好的,我试一下[哈哈]
2017年01月11日 00点01分
1