怎样把HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs分支中的键值及键值数据分别显示在Listbox1中组件中,但是只用二个Listbox1组件)请用代码举例说明。
解决方案 »
- 问一个fastreport的脚本编写简单问题,请教大家
- TShape自定义键盘事件
- 50分请教:Privileged instruction问题?
- 紧急求救,关于三层中间层内存消耗系统死机问题,在线盼
- 一个数据类型转换的问题
- 俺做了一个文档管理系统,用TREEVIEW和LISTVIEW管理的,谁想要代码?
- windows中的用户组和用户的图标放在哪个文件里?
- 请高手帮忙写一个程序....打印一个表格
- 窗体的问题,请教各位高手
- 请问大家用delphi都做过哪些软件呢?能否提供下载以便欣赏呢?(无源码也可)
- 《delphi 5.x ADO/MTS/COM+高级程序设计篇》一书例子的源代码那又下载?
- mdichild???
registry.rootkey:=HKEY_LOCAL_MACHINE;
registry.openkey('Software\Microsoft\Windows\CurrentVersion\SharedDlls',True);listbox......
registry.free;
var
Reg: TRegistry;
Val:TStringList;
I:Integer;
begin
Reg:=TRegistry.Create;
try
Val:=TStringList.Create;
try
Reg.RootKey:=HKEY_LOCAL_MACHINE; // Section to look for within the registry
if not Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\SharedDlls',False) then
ShowMessage('Error opening key')
else
begin
Reg.GetKeyNames(Listbox1.Items);
Reg.GetValueNames(Listbox2.Items); finally
Reg.Free;
end;
end;
var
Reg: TRegistry;
Val:TStringList;
I:Integer;
begin
Reg:=TRegistry.Create;
try
Val:=TStringList.Create;
try
Reg.RootKey:=HKEY_LOCAL_MACHINE; // Section to look for within the registry
if not Reg.OpenKey('Software\Microsoft\Windows\CurrentVersion\SharedDlls',False) then
ShowMessage('Error opening key')
else
begin
Reg.GetKeyNames(Listbox1.Items);
Reg.GetValueNames(Listbox2.Items); end
finally
Reg.Free;
end;
end;
str : TStrings;
Reg : TRegistry;
i : Integer;
t : TRegDataInfo;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_LOCAL_MACHINE;
if reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs' ,false) then
begin
str:=TStringList.Create;
reg.GetValueNames(str);
GetClassForm.ListBox1.Items.AddStrings(str);
for i:=0 to str.Count-1 do
begin
reg.GetDataInfo(str[i],t);
case t.RegData of
rdString,rdExpandString:ListBox2.Items.Add(
reg.ReadString(str.Strings[i]));
rdInteger:ListBox2.Items.Add(
IntToStr(reg.ReadInteger(str.Strings[i])));
end;
end;
str.Free;
end;
Reg.Free;
end;