首页 > 代码库 > C# 数组快速读取和写入

C# 数组快速读取和写入

摘要:

C# 数组快速读取和写入

1 BinaryFormatter binaryFormatter = new BinaryFormatter();
2 FileStream fileStream = new FileStream(@"E:\context.txt", FileMode.Create);
3 binaryFormatter.Serialize(fileStream, a);
4 fileStream.Dispose();
5 
6 FileStream s = new FileStream(@"E:\context.txt", FileMode.Open);
7 float[,] b = (float[,])(binaryFormatter.Deserialize(s));

 

C# 数组快速读取和写入