public partial class MainWindow : Window
{
public MainWindow()
{
BinaryReader br = new BinaryReader(File.Open(FILE_NAME, FileMode.Open));
long dataLength = br.BaseStream.Length;
byte[] a = new byte[br.BaseStream.Length];
a= br.ReadBytes((int)br.BaseStream.Length);
InitializeComponent();
}
....
readData is byte array read from a binary file. How can we make this byte array into a DataGrid of 5 columns using c#?
like this...
position| 0 | 1 | 2 | 3 | 4 |
0 |a[0]|a[1]|a[2]|a[3]|a[4]|
1 |a[5]|a[6]|a[7]|a[8]|a[9]|
...
I tried to create an object with 9 bytes and do it with ListView, but I didn't think this was appropriate for future work...
public class Data
{
public int position { get; set; }
public byte _0 { get; set; }
public byte _1 { get; set; }
public byte _2 { get; set; }
public byte _3 { get; set; }
public byte _4 { get; set; }
public byte _5 { get; set; }
public byte _6 { get; set; }
public byte _7 { get; set; }
public byte _8 { get; set; }
public byte _9 { get; set; }
public byte _A { get; set; }
public byte _B { get; set; }
public byte _C { get; set; }
public byte _D { get; set; }
public byte _E { get; set; }
public byte _F { get; set; }
}