16进制 41 A1 0A 3D 具体是怎么转换成浮点数的。
请知道 的给段C#代码

解决方案 »

  1.   

    十六进制转换为浮点型      string shuju = this.textBox1.Text.Trim();            uint num = uint.Parse(shuju, System.Globalization.NumberStyles.AllowHexSpecifier);            byte[] floatValues = BitConverter.GetBytes(num);            float f = BitConverter.ToSingle(floatValues, 0);            this.label1.Text = Convert.ToDecimal(f) + "";
    浮点型转换为十六进制
    float f = Convert.ToSingle(textBox1.Text);
                byte[] bytes = BitConverter.GetBytes(f);//把浮点型转换为字节类型
                Array.Reverse(bytes);//反转一维数组中某部分元素的顺序
                label1.Text = BitConverter.ToString(bytes).Replace("-", "");