C#忽略XML文件注释

直接上代码:

XmlDocument xmlDoc = new XmlDocument();
XmlReaderSettings settings = new XmlReaderSettings();   
settings.IgnoreComments = true; //忽略注释 
XmlReader reader = XmlReader.Create(filePath, settings);    
xmlDoc.Load(reader);

 

posted @ 2013-05-27 11:31  爹子王  阅读(649)  评论(0编辑  收藏  举报