下面是更完整的程序,不用控件。<br><br>function tohexstr(value:byte): string;<br>var count :integer;<br> howfar,tmp,andresul:word;<br> output :string;<br>begin<br> Howfar:=15;<br> Output:='';<br> tmp:=Value;<br> { One bit at a time }<br> For count:=1 To 2 Do<br> Begin<br> AndResul:=tmp AND Howfar;<br> case AndResul Of<br> 0 : OutPut:='0'+Output;<br> 1 : OutPut:='1'+Output;<br> 2 : OutPut:='2'+Output;<br> 3 : OutPut:='3'+Output;<br> 4 : OutPut:='4'+Output;<br> 5 : OutPut:='5'+Output;<br> 6 : OutPut:='6'+Output;<br> 7 : OutPut:='7'+Output;<br> 8 : OutPut:='8'+Output;<br> 9 : OutPut:='9'+Output;<br> 10 : OutPut:='A'+Output;<br> 11 : OutPut:='B'+Output;<br> 12 : OutPut:='C'+Output;<br> 13 : OutPut:='D'+Output;<br> 14 : OutPut:='E'+Output;<br> 15 : OutPut:='F'+Output;<br> End;<br> tmp:=tmp DIV 16;<br> End;<br> result := output;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var finifile : TRegistry;<br> buffer : array[0..1024] of byte;<br> i : integer;<br>begin<br> finifile := TRegistry.create;<br> FiniFile.OpenKey('/SoftWare/EasySoft/邮件快递/', true);<br> label1.caption := inttostr(FInifile.ReadBinaryData('test',buffer,sizeof(buffer))) + ' ';<br> for i := 1 to FInifile.ReadBinaryData('test',buffer,sizeof(buffer)) do<br> label1.caption := label1.caption + ' ' + tohexstr(buffer[i-1]);<br> finifile.Free;<br>end;<br>