Delphi扩展到C# [英] Delphi Extended to C#
本文介绍了Delphi扩展到C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将浮点数10个字节的十六进制字符串(在Delphi中为扩展数据类型)转换为C#数据类型?
how to convert a floating point 10 byte Hex string (Extended datatype in Delphi) to a C# datatype?
例如:
00 00 00 00 00 00 00 80 ff 3f 位于Delphi 1
For example: 00 00 00 00 00 00 00 80 ff 3f is at Delphi 1
推荐答案
好,这是我的解决方案:
Ok, here is my solution:
每个字符串在第二个位置都包含一个因子字节。在我的示例中,因子为 ff 。
Every string contains a factor byte at the second position. In my example the factor is ff.
现在,我必须通过将浮点转换转换为十进制,然后乘以因子字节即可得到结果。
Now I have to convert the string via Floating-Point Conversion to decimal and multiply with the factor byte to get the result.
示例:
3f ff 80 00 00(32位)->删除因数字节(ff)-> 3f 80 00 00->转换为小数->结果:1->乘法加上因子-> 1 * 1->结果: 1
我希望这会有所帮助
这篇关于Delphi扩展到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文