Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个用 C 语言编写的二进制文件,其中包含一长串数字。首先,它随后包含 4 次 int(因此前 16 个字节是 4 个 int),然后它包含双精度数(我假设每 8 个字节一个新的双精度数)。
在任何点或其他任何地方都没有空格。现在我需要用 C# 读取数据,但到目前为止,我尝试的一切都不起作用,有什么建议吗?
using (BinaryReader br = new BinaryReader(File.Open("file", FileMode.Open))) { int a = br.ReadInt32(); int b = br.ReadInt32(); int c = br.ReadInt32(); int d = br.ReadInt32(); double e = br.ReadDouble(); double f = br.ReadDouble(); ... }