0

問題が発生しました。

Vb6 を使用して作成されたことがわかっているバイナリ データがあり、C# を使用してすべての情報を読み取りたいと考えています。

これどうやってするの?

私はファイルのデータ構造を知りません!!!

ご清聴ありがとうございました

4

1 に答える 1

4

バイナリ ストリームの構造がわかっている場合は、BinaryReaderクラスを使用できます。

using (Stream inputStream = new FileStream("test.bin", FileMode.Open, FileAccess.Read, FileShare.Read))
using (BinaryReader reader = new BinaryReader())
{
    int value1 = reader.ReadInt32(); // read 32 bit integer
    float value2 = reader.ReadSingle(); // read a single-precision 32-bit number
    char[] value3 = reader.ReadChars(10); // read 10, 16-bit unicode characters
    ...
}

読み取ろうとしている構造がわからない場合は、難しい推測が必要になります。

于 2009-03-08T17:48:33.287 に答える