🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: be.comp.programming
Article #2999

Re: Code

#2999
From: Karel de Andere
Date: Mon, 16 Feb 2004 19:32
45 lines
2251 bytes
"JVB" <jvbsoft.verwijder.dit@pandora.be> schreef in bericht
news:Pr1Yb.3207$yt5.118901@phobos.telenet-ops.be...
> Hoe kan ik met Delphi code een "codewoord" in het register bakken ??
Gebeurt
> met TRegistry , maar hoet moet het dan verder ??     Dank ......
>

Hier hopelijk een normaal antwoord.
Er worden 2 globaal gedeclareerde variabelen gelzezen en geschreven. Ik neem
aan dat dit voldoende basis is.


procedure TfMain.GetRegister;
var
  reg: TRegistry;
begin
  gProfile:='';
  gLastDir:='';
  reg:=TRegistry.Create;
  try
    reg.RootKey:=HKEY_LOCAL_MACHINE;
    reg.OpenKey('Software\Companyname\'+cAppName+'\'+cAppVersion,true);
    if reg.ValueExists('gProfile') then
gProfile:=reg.ReadString('gProfile');
    if reg.ValueExists('gLastDir') then gLastDir:=reg.ReadString('gLastDir')
  finally
    reg.free;
    end;
  end;

procedure TfMain.SetRegister;
var
  reg: TRegistry;
begin
  reg:=TRegistry.Create;
  try
    reg.RootKey:=HKEY_LOCAL_MACHINE;
    reg.OpenKey('Software\Companyname\'+cAppName+'\'+cAppVersion,true);
    reg.WriteString('gProfile',gProfile);
    reg.WriteString('gLastDir',gLastDir);
  finally
    reg.free;
    end;
  end;
Technical Details
Message-ID: <40311ab6$0$558$e4fe514c@news.xs4all.nl>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.wirehub.nl!transit.news.xs4all.nl!newsfeed.xs4all.nl!xs4all!not-for-mail
References: <Pr1Yb.3207$yt5.118901@phobos.telenet-ops.be>

Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit
X-Google-Thread: 107324,4fd33a488254e77e
X-Google-Attributes: gid107324,public
X-Google-Thread: fcea4,4fd33a488254e77e
X-Google-Attributes: gidfcea4,public
X-Google-ArrivalTime: 2004-02-16 11:32:07 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.wirehub.nl!transit.news.xs4all.nl!newsfeed.xs4all.nl!xs4all!not-for-mail
From: "Karel de Andere" <kdan@slimvisje.nl>
Newsgroups: be.comp.programming,nl.comp.programmeren
References: <Pr1Yb.3207$yt5.118901@phobos.telenet-ops.be>
Subject: Re: Code
Date: Mon, 16 Feb 2004 20:32:53 +0100
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Lines: 49
Message-ID: <40311ab6$0$558$e4fe514c@news.xs4all.nl>
NNTP-Posting-Date: 16 Feb 2004 20:32:06 CET
NNTP-Posting-Host: 80.126.2.211
X-Trace: 1076959926 news.xs4all.nl 558 [::ffff:80.126.2.211]:20777
X-Complaints-To: abuse@xs4all.nl