J
jhlz1968
Unregistered / Unconfirmed
GUEST, unregistred user!
我的表单上有一个CheckListBox组件,表单启动时,我从注册表中把IE地址栏中的网址已经读到了CheckListBox中,现在我想根据选择清除部分网址,代码如下:
procedure TForm1.BitBtn1Click(Sender: TObject);
var
urlKey: TRegistry;
i: Integer;
KeyList: TStringList;
begin
urlKey:=TRegistry.Create;
keyList:=TStringList.Create;
try
urlKey.RootKey:=HKEY_CURRENT_USER;
urlKey.OpenKey('/SoftWare/Microsoft/Internet Explorer/TypedURLs/',True);
urlKey.GetValueNames(keyList);
for i:=0 to keyList.Count-1 do
begin
if CheckListBox1.Checked then
begin
urlKey.DeleteValue(CheckListBox1.items.Strings);
end;
end;
urlKey.closekey;
finally
urlKey.Free;
keyList.Free;
end;
end;
却总是删除不了。请各位帮忙。
procedure TForm1.BitBtn1Click(Sender: TObject);
var
urlKey: TRegistry;
i: Integer;
KeyList: TStringList;
begin
urlKey:=TRegistry.Create;
keyList:=TStringList.Create;
try
urlKey.RootKey:=HKEY_CURRENT_USER;
urlKey.OpenKey('/SoftWare/Microsoft/Internet Explorer/TypedURLs/',True);
urlKey.GetValueNames(keyList);
for i:=0 to keyList.Count-1 do
begin
if CheckListBox1.Checked then
begin
urlKey.DeleteValue(CheckListBox1.items.Strings);
end;
end;
urlKey.closekey;
finally
urlKey.Free;
keyList.Free;
end;
end;
却总是删除不了。请各位帮忙。