1 private BinaryReader brShapeIndex; //读取记录; 2 filename = "文件绝对路径"; 3 fs = new FileStream(filename, FileMode.Open, FileAccess.Read); 4 brShapeIndex = new BinaryReader(fs, Encoding.Unicode); 5 for (int i = 0; i <10000; i++) 6 { 7 long z = i * 8; 8 brShapeIndex.BaseStream.Seek(z, 0); 9 label1 = brShapeIndex.ReadInt16(); 10 label2 = brShapeIndex.ReadInt16(); 11 label3 = brShapeIndex.ReadInt16(); 12 label4 = brShapeIndex.ReadInt16(); 13 14 DataRow dr = db.NewRow(); 15 dr["a"] = label1; 16 dr["b"] = label2; 17 dr["c"] = label3; 18 dr["d"] = label4; 19 db.Rows.Add(dr); 20 }
}
struct 是二进制文件中的 一条记录的结构吗
struct中的成员 有顺序吗