delphi7中如何修改注册表键值 Delphi / Windows SDK/APIhttp://www.delphi2007.net/DelphiAPI/html/delphi_20061130225610144.html
delphi7中如何修改注册表键值啊? 详细点 最好有实例
procedure TClientMainForm.SaveUserSetup(IsKey: Boolean);
var
Reg: TRegistry;
i: Integer;
begin
Reg := TRegistry.Create;
try
if Reg.OpenKey(RegPath, False) then
begin
if IsKey then
begin
FPassWord := UseKeyForm.Edit1.Text;
FDialName := UseKeyForm.ComboBox1.Text;
FHtmlAddr := UseKeyForm.Edit3.Text;
Reg.WriteString('PassWord', PassWord);
Reg.WriteString('DialName', DialName);
Reg.WriteString('HtmlAddr', HtmlAddr);
end else
with ClientDataForm.UsersCDS do
begin
FUserCode := FieldByName('CODE').Value;
FUserName := FieldByName('NAME').Value;
i := Length(FUserName);
while (i > 0) and (FUserName[i] = #32) do
begin
FUserName[i] := #0;
Dec(i);
end;
FLine := FieldByName('LINE').Value;
FViewClass := FieldByName('VIEWCLASS').Value;
Reg.WriteString('UserCode', UserCode);
Reg.WriteString('UserName', UserName);
Reg.WriteString('ViewClass', ViewClass);
Reg.WriteString('ComputerName', ComputerName);
Reg.WriteString('Line', Line);
end;
end;
finally
Reg.Free;
end;
end;