我编的二进制转十六进制函数: function BinToHex(bin:string):string; var i,l : integer; begin i := 0; for l:=1 to length(bin) do begin i := i * 2; if (bin[l]='1') then inc(i) else if (bin[l]<>'0') then raise Exception.Create('Error!'); end; result := inttohex(i,1); end;