小弟在读注册表的一个二进值键值的时候,试着用下列的方法,不能读出数据来,请高手指点了。
有这方面的DEMO吗?
REG_BINARY :
                begin
                   ListItem.SubItems.Add('REG_BINARY值');
                   Reg.openkey(s,false);
                   vSize := reg.GetDataSize(buf);
                   if (vSize > 0) then
                   begin
                     SetLength(tmpStr, vSize);
                     Reg.ReadBinaryData(buf, tmpstr[1], vSize);
                     repeat
                      p := Pos(#0, tmpStr);
                       if p <> 0 then
                       begin
                        Delete(tmpStr, p, 1);
                         Insert(#13#10, tmpStr, p);
                        end;
                      until
                          p = 0;
                   end;                  ListItem.SubItems.Add(tmpstr);//这里!!

解决方案 »

  1.   

    例子如下
    procedure TForm1.Button1Click(Sender: TObject);
    var finifile : TRegistry;
        buffer : array[0..1024] of byte;
         i : integer;
    begin
      finifile := TRegistry.create;
      FiniFile.OpenKey('你的路径', true);
      label1.caption := inttostr(FInifile.ReadBinaryData('test',buffer,sizeof(buffer))) + ' ';
      for i := 1 to FInifile.ReadBinaryData('test',buffer,sizeof(buffer)) do
         label1.caption := label1.caption + ' ' + inttohex(dword(buffer[i-1]),2);
      finifile.Free;
    end;
      

  2.   

    http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=193103