LittleWhite123 2016-10-15 01:29 采纳率: 53.1%
浏览 968
已采纳

c#数据流,读不出来。。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace DECODE
{
class Program
{
static void Main(string[] args)
{
string path = @"frame_0_right.dat";
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Byte data = br.ReadByte();
//string str = System.Text.Encoding.Default.GetString(byte[data]);
Console.Write(data.ToString("X2"));
Console.Read();

    }
}

}
只能读出来最开始的EA,后面的为什么读不出来

  • 写回答

2条回答 默认 最新

  • threenewbee 2016-10-15 02:06
    关注

    string path = @"frame_0_right.dat";
    byte[] data = File.ReadAllBytes(path);
    foreach (byte b in data.SkipWhile(x => x != 0xea))
    {
    Console.Write(b.ToString("X2") + " ");
    }

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?