c# XML序列化
标签:begin serialize oid origin col ret 序列化 HERE lse
public static T Deserialize(S stream) where S : Stream where T : class, new()
{
using (stream)
{
XmlSerializer xmlSearializer = new XmlSerializer(typeof(T));
// fileStream.Position = 0;
// fileStream.Seek(0, SeekOrigin.Begin);
return (T)xmlSearializer.Deserialize(stream);
}
}
public static void Serialize(T obj, S stream) where S : Stream where T : class, new()
{
using (stream)
{
XmlSerializer xmlFormat = new XmlSerializer(typeof(T));
xmlFormat.Serialize(stream, obj);
}
}
c# XML序列化
标签:begin serialize oid origin col ret 序列化 HERE lse
原文地址:https://www.cnblogs.com/yuanzijian-ruiec/p/9720885.html
文章来自:
搜素材网的
编程语言模块,转载请注明文章出处。
文章标题:
c# XML序列化
文章链接:http://soscw.com/index.php/essay/102551.html
评论