1.将数据存为二进制文件
var filePath = AppDomain.CurrentDomain.BaseDirectory + "TableGly.bin";
using (var s = File.Create(filePath))
{
var bin = new BinaryFormatter();
bin.Serialize(s, glylist);
}
2.将二进制文件都出来
var filePath = AppDomain.CurrentDomain.BaseDirectory + "TableGly.bin";
using (var s = File.Open(path, FileMode.Open))
{
var bin = new BinaryFormatter();
var list = bin.Deserialize(s) as List<long>;
if (list != null)
{
var str = string.Join(",", list3.ToArray());
}
}