赞
踩
static void SaveAsBinaryFormat(object obj,string filename)
{
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter binFormat =
new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
using(System.IO.Stream fsStream = new System.IO.FileStream(filename,System.IO.FileMode.Create,
System.IO.FileAccess.Write,System.IO.FileShare.None))
{
binFormat.Serialize(fsStream, obj);
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。