新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
xmlSerializer怎么在C#項(xiàng)目中使用
xmlSerializer怎么在C#項(xiàng)目中使用?針對(duì)這個(gè)問(wèn)題,這篇文章詳細(xì)介紹了相對(duì)應(yīng)的分析和解答,希望可以幫助更多想解決這個(gè)問(wèn)題的小伙伴找到更簡(jiǎn)單易行的方法。
潮州網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián)公司,潮州網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為潮州近千家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的潮州做網(wǎng)站的公司定做!
public class Entity { public Entity() { } public Entity(string c, string f) { name = c; school = f; } public string name; public string school; }
使用時(shí)聲明
ListentityList=null; XmlSerializer xs = new XmlSerializer(typeof(List ));
讀入
using (StreamReader sr = new StreamReader(configPath)) { entityList = xs.Deserialize(sr) as List; }
輸出
using (StreamWriter sw = File.CreateText(configPath)) { xs.Serialize(sw, entityList); }
對(duì)應(yīng)的xml
Alice SJTU Cici CSU Zero HIT
關(guān)于 xmlSerializer怎么在C#項(xiàng)目中使用問(wèn)題的解答就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,如果你還有很多疑惑沒(méi)有解開(kāi),可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識(shí)。
分享名稱:xmlSerializer怎么在C#項(xiàng)目中使用
分享路徑:http://fisionsoft.com.cn/article/jgcegd.html