十六位字符串 42363333 (左高右低)
刚才自己做了一会没做出来 
求解

解决方案 »

  1.   

                Console.Write(int.Parse("42363333",System.Globalization.NumberStyles.HexNumber));
                Console.WriteLine( float.Parse(Convert.ToInt32("42363333", 16).ToString()));  
      

  2.   

    这么写吧0x42 0x36 0x33 0x33 (左高右低) 
    计算后的float应该是45.55 
      

  3.   


    public string FloatToHex(float floatValue)
    {
        uint uintValue = BitConverter.ToUInt32(BitConverter.GetBytes(floatValue), 0);
        byte[] byteValue = BitConverter.GetBytes(uintValue);
        Array.Reverse(byteValue);
        return BitConverter.ToString(byteValue).Replace("-","");
    }public float HexToFloat(String hexString)
    {
        uint num = uint.Parse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier);
        byte[] floatVals = BitConverter.GetBytes(num);
        return BitConverter.ToSingle(floatVals, 0);
    }
      

  4.   

    5 楼正确,5楼是按照我们常人习惯的读写顺序进行hex转换的。
    楼主hex2byte那贴,一二楼是按照.net 内部 高低位做的转换,理解上可能困难些。 
    这个更书本化、正统一些。