[Delphi] 纯文本查看 复制代码 Function RegToStr(PassReg : TRegistry; GetString : String) : String;
Var
Value : Integer;
Size : Integer;
Buffer : Array of Byte;
TmpStr : String;
I : integer;
Begin
Try
Case PassReg.GetDataType(GetString) Of
rdString : Begin
Result := PassReg.ReadString(GetString);
end;
rdInteger : Begin
Value := PassReg.ReadInteger(GetString);
Result := IntToStr(Value);
end;
rdBinary : Begin
Size := PassReg.GetDataSize(GetString);
If Size > 0 Then Begin
SetLength(Buffer, Size);
PassReg.ReadBinaryData(GetString, Buffer[0], Size);
TmpStr := '';
For I := 0 to Size - 1 do TmpStr := TmpStr + Format('%.2X ', [Buffer[I]]);
Delete(TmpStr, Length(TmpStr), 1);
Result := TmpStr;
end;
end;
end;
Except
Result := '[error reading]';
end;
If Result = '' Then Result := '[null]';
end;
百度那狗屎,又没找到,干什么吃的? 吃尿吧。 |