把01000000转化成10进制数为多少怎么转化

解决方案 »

  1.   

    64
    function BinToInt(Value: string): Integer;vari, iValueSize: Integer;beginResult := 0;iValueSize := Length(Value);for i := iValueSize downto 1 doif Value[i] = '1' then Result := Result + (1 shl (iValueSize - i));end;
      

  2.   

    先转换成十六进制
    Converts a binary value into its hexadecimal representation.UnitClassesCategorytype conversion routinesprocedure BinToHex(Buffer, Text: PChar; BufSize: Integer);DescriptionCall BinToHex to convert the binary value in a buffer into a string that is its hexadecimal representation.Buffer is a buffer of bytes that contains the binary value.Text returns a null-terminated string that represents the value of Buffer as a hexadecimal number.BufSize is the size of Buffer. Text needs to point to a sequence of characters that has at least 2*BufSize bytes because each hexadecimal character represents two bytes再将十六进制转换为10进制Converts a string that represents an integer (decimal or hex notation) to a number.UnitSysUtilsCategorytype conversion routinesfunction StrToInt(const S: string): Integer;DescriptionStrToInt converts the string S, which represents an integer-type number in either decimal or hexadecimal notation, into a number. If S does not represent a valid number, StrToInt raises an EConvertError exception.