Article View: cn.bbs.comp.program
Article #457Re: ��Delphi����ע�������!
From: ����~ ��������
Date: Fri, 10 Jul 1998 00:00
Date: Fri, 10 Jul 1998 00:00
36 lines
1467 bytes
1467 bytes
> [1;36m==> Totty_Yu(һ�쵽����Ӿ����) ˵��: [37;40m[0m
> ��д�����´���,���ȡע��������,
> var
> Reg : TRegisty ;
> begin
> Reg := TRegistry.Create ;
> Reg.OpenKey ( 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Extension', True ) ;
> sst := Reg.ReadString ( '.txt' ) ;
> ...
> end ;
> ����ʱ,sst���Ϊ��,why ? OpenKey �ɹ�����True ;
>
Hi, Try these codes....
var
Reg : TRegistry;
sst : string;
begin
Reg := TRegistry.Create;
With Reg do begin
RootKey:= HKEY_LOCAL_MACHINE;
Reg.OpenKey('SOFTWARE\Microsoft\Windows\CurrentVersion',False);
// or u can write
// Reg.OpenKeyReadOnly('SOFTWARE\Microsoft\Windows\CurrentVersion');
sst := Reg.ReadString ( 'Version' ) ;
end;
Reg.Free;
end;
TIPS: HKEY_LOCAL_MACHINE is not a string but a constant number.
Good luck!
--
�� ��Դ: �й�ƴ�BBSվ [bbs.ustc.edu.cn]
Technical Details
Message-ID:
<980710.yudbZ$PBBS@bbs.ustc.edu.cn>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fc86e,9e13b3d5ef2aaac5,start X-Google-Attributes: gidfc86e,public From: Sea_Boy@bbs.ustc.edu.cn (����~ ��������) Subject: Re: ��Delphi����ע�������! Date: 1998/07/10 Message-ID: <980710.yudbZ$PBBS@bbs.ustc.edu.cn> X-Deja-AN: 370903704 Organization: �й�ƴ�BBSվ Newsgroups: cn.bbs.comp.program