太
太阳河上
Unregistered / Unconfirmed
GUEST, unregistred user!
我在操作注册表时,见以下程序:
procedure TFTPSysForm.BitBtn1Click(Sender: TObject);
var Reg: TRegistry;
begin
Reg:=TRegistry.Create;
with Reg do
begin
RootKey:=HKEY_USERS;
if OpenKey('.DEFAULT/Software/AdultFTPSys',True) then
begin
WriteString('Host',HostText.Text);
WriteInteger('Port',StrToInt(PortText.Text));
WriteString('UserID',UserIDText.Text);
WriteString('PassWord',PassWordText.Text);
WriteBool('ProxyYes',CheckBox1.Checked);
if CheckBox1.Checked then
begin
WriteString('ProxyHost',ProxyHost.Text);
WriteInteger('ProxyPort',StrToInt(ProxyPort.Text));
end else
begin
WriteString('ProxyHost','');
WriteInteger('ProxyPort',0);
end;
CloseKey;
end;
end;
Reg.Free;
SetSys:=10;
Close;
end;
注:刚开始时/AdultFTPSys键不存在,
在Win98下没有问题,会创建/AdultFTPSys键,但在win2000下行,不能建/AdultFTPSys
为什么?
procedure TFTPSysForm.BitBtn1Click(Sender: TObject);
var Reg: TRegistry;
begin
Reg:=TRegistry.Create;
with Reg do
begin
RootKey:=HKEY_USERS;
if OpenKey('.DEFAULT/Software/AdultFTPSys',True) then
begin
WriteString('Host',HostText.Text);
WriteInteger('Port',StrToInt(PortText.Text));
WriteString('UserID',UserIDText.Text);
WriteString('PassWord',PassWordText.Text);
WriteBool('ProxyYes',CheckBox1.Checked);
if CheckBox1.Checked then
begin
WriteString('ProxyHost',ProxyHost.Text);
WriteInteger('ProxyPort',StrToInt(ProxyPort.Text));
end else
begin
WriteString('ProxyHost','');
WriteInteger('ProxyPort',0);
end;
CloseKey;
end;
end;
Reg.Free;
SetSys:=10;
Close;
end;
注:刚开始时/AdultFTPSys键不存在,
在Win98下没有问题,会创建/AdultFTPSys键,但在win2000下行,不能建/AdultFTPSys
为什么?