如何将字节转换为十进制?

发布于 2024-08-12 16:49:43 字数 298 浏览 1 评论 0原文

请指导我如何将该输入转换为decimal.tq。

BF C2 FF 12 
65 E4 EE 
17 BF C2 64 F2 41 84 11 
C1 C4 38 41 14 10 C1 04 10 49 04 18 41 06 72 B5 FF 
17 BF C2 64 72 
41 84 11 C1 85 19 C1 07 17 7D C2 5F 3D 5E FD DE 57 FD 10 E1 94 30 B5 FF 
17 BF C2 FF 12 
65 CC 76 
17 BF C2 FF 12 
69 FC 77 

Please guide me how make convert that input to decimal.tq.

BF C2 FF 12 
65 E4 EE 
17 BF C2 64 F2 41 84 11 
C1 C4 38 41 14 10 C1 04 10 49 04 18 41 06 72 B5 FF 
17 BF C2 64 72 
41 84 11 C1 85 19 C1 07 17 7D C2 5F 3D 5E FD DE 57 FD 10 E1 94 30 B5 FF 
17 BF C2 FF 12 
65 CC 76 
17 BF C2 FF 12 
69 FC 77 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

失去的东西太少 2024-08-19 16:49:43

如果您使用的是 Windows,请打开计算器并查看科学计算器。然后,您可以一次一组地转换一小段代码。

手动计算时,您需要除以 16,直到得到零,然后将余数合并起来。

If you have Windows open up the calculator and go to view scientific. Then you can convert small pieces of your code one group at a time.

To do it by hand you divide by 16 until you get zero and then you combine the remainders.

浊酒尽余欢 2024-08-19 16:49:43
Dim input As String = "BF C2 FF 12 65 E4 EE 17 BF C2 64 [...]"
For Each s As String In input.Split(" "c)
    Dim value As Integer = Convert.ToInt32(s, 16)
    Console.Write(value & " ")    ' Or whatever else you want to do with the converted data
Next
Dim input As String = "BF C2 FF 12 65 E4 EE 17 BF C2 64 [...]"
For Each s As String In input.Split(" "c)
    Dim value As Integer = Convert.ToInt32(s, 16)
    Console.Write(value & " ")    ' Or whatever else you want to do with the converted data
Next
一场信仰旅途 2024-08-19 16:49:43

您应该告诉我们您的输入和想要的输出格式。
我假设您的数据位于名为“input”的字符串变量中,并且希望将其作为字节数组。

Dim input As String = IO.File.ReadAllText("C:\data.txt")
Dim output As Byte() = input.Split(" ").Select(Function(b) Convert.ToByte(b, 16)).ToArray

编辑:

For Each part As String In IO.File.ReadAllText("C:\data.txt").Split(" ")
    If part.Trim.Length > 0 Then
        Dim number As Integer = Convert.ToInt32(part, 16)
        Console.Write(number & ",")
    End If
Next

You should tell us your input and wanted output format.
I assumed you have the data in a String variable named "input" and want it as byte array.

Dim input As String = IO.File.ReadAllText("C:\data.txt")
Dim output As Byte() = input.Split(" ").Select(Function(b) Convert.ToByte(b, 16)).ToArray

Edit:

For Each part As String In IO.File.ReadAllText("C:\data.txt").Split(" ")
    If part.Trim.Length > 0 Then
        Dim number As Integer = Convert.ToInt32(part, 16)
        Console.Write(number & ",")
    End If
Next
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文