如何将一个Dictionary<string,object>序列化成byte
1个回答
推荐于2016-10-03 · 知道合伙人影视综艺行家
关注
展开全部
Dictionary<string, string> dic1= new Dictionary<string, string>();
dic1.Add("1", "1");
dic1.Add("2", "2");
MemoryStream ms = new MemoryStream();
bf.Serialize(ms, dic1);
byte[] buffer = ms.GetBuffer();
MemoryStream ms1 = new MemoryStream(buffer);
Dictionary<string, string> dic2= (Dictionary<string, string>)bf.Deserialize(ms1);
dic1.Add("1", "1");
dic1.Add("2", "2");
MemoryStream ms = new MemoryStream();
bf.Serialize(ms, dic1);
byte[] buffer = ms.GetBuffer();
MemoryStream ms1 = new MemoryStream(buffer);
Dictionary<string, string> dic2= (Dictionary<string, string>)bf.Deserialize(ms1);
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询