// aaa 下有bbb 里面同样有键的,不过我一样删除了var
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Try
Reg.RootKey:=HKEY_LOCAL_MACHINE;
if Reg.OpenKey('\Software\',True) then
Reg.DeleteKey('aaa');
Finally
Reg.Closekey;
Reg.Free; end;
Reg:TRegistry;
begin
Reg:=TRegistry.Create;
Try
Reg.RootKey:=HKEY_LOCAL_MACHINE;
if Reg.OpenKey('\Software\',True) then
Reg.DeleteKey('aaa');
Finally
Reg.Closekey;
Reg.Free; end;
解决方案 »
- 问事件跨单元引用
- 一个小问题,请大家帮忙。
- listview简单问题
- delphi中把整型数据转换成浮点型的函数
- 怎样随意控制打印过程(高分)?
- delphi spcomm组件中Comm1ReceiveData为什么接收不到短信啊
- 这段代码的错误在哪里?
- 当我的combobox下拉框里面的内容长度大于combobox的长度时,如何完整显示出下拉内容
- 大家见过Acrobat Reader 这个软件吧,我做了一个类似的软件,好像是csdn出问题了,上传不了,留下邮箱或qq吧.(不过用了人家的rxlib7.2控件)嘿嘿
- 如何实现office97样式的菜单栏?
- 一个很简单的问题
- 请问如何用delphi语言将一文件夹压缩?
Val:TstringList;
Reg:TRegistry;
i:integer;
begin
Reg:=TRegistry.Create;
try
Val:=TStringList.Create;
try
Reg.RootKey:=HKEY_LOCAL_MACHINE; //注册表的主键值
if Reg.OpenKey('此处为键的位置',False) then
begin
Reg.GetValueNames(Val); //Memo1.lines:=Val;
if Val.count<1
ShowMessage(子键为空)
....
end;
finally
val.Free;
end;
finally
Reg.Free;
end;
end;