请问各位怎么读取注册表里的字符串/?(50分)

Q

qqli

Unregistered / Unconfirmed
GUEST, unregistred user!
如HKEY_LOCAL_MACHINE、SOFTWARE/Microsoft/Windows/CurrentVersion/Run里的字符串值
当它存在时返回为真(ture)反之为假(fals)![:)]
 
很多这样的帖子了。
最近好像就发了一个。
 
下面是葵花宝典上的,你少加改动即可
Var Reg : TRegistry;
list : TStrings;
i : Integer;
Begin
Reg:=TRegistry.Create;
Reg.RootKey:='HKEY_LOCAL_MACHINE';
If Reg.OpenKey('/Software/Microsoft/CurrentVersion/Run', false) then
Begin
List:=TStringList.Create;
Reg.GetValueNames(List);
For i:=0 to list.Count-1 do
If Reg.ValueExists(List) then
Begin
Case Reg.GetDataType(List) of
rdInteger: Reg.ReadInteger(List);
rdBinary: Reg.ReadBinaryData(List);
else
Reg.ReadString(List);
End;
End;
End;
End;
 
USES Registry;
 
接受答案了.
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
772
import
I
顶部