myamanda

博客园 首页 新随笔 联系 订阅 管理
在USES clause: Registry

function GetRegDataType ( const strRegPath, strRegValue: string ): string;
var
regRegistry: TRegistry;
S: string;
begin
try
regRegistry := TRegistry.Create;

regRegistry.RootKey := HKEY_LOCAL_MACHINE;
if regRegistry.OpenKey ( strRegPath, false ) then begin
case Reg.getDataType ( strRegValue ) of
rdUnknown: S := 'Unknown';
rdString: S := 'String';
rdExpandString: S := 'ExpandString';
rdInteger: S := 'Integer';
rdBinary: S := 'Binary';
end;
end else
s := 'Can not get data type.';
finally
regRegistry.Free;
end;

result := s;
end
posted on 2009-12-23 14:05  myamanda  阅读(219)  评论(0)    收藏  举报