C#忽略XML文件注释
直接上代码:
XmlDocument xmlDoc = new XmlDocument(); XmlReaderSettings settings = new XmlReaderSettings(); settings.IgnoreComments = true; //忽略注释 XmlReader reader = XmlReader.Create(filePath, settings); xmlDoc.Load(reader);
直接上代码:
XmlDocument xmlDoc = new XmlDocument(); XmlReaderSettings settings = new XmlReaderSettings(); settings.IgnoreComments = true; //忽略注释 XmlReader reader = XmlReader.Create(filePath, settings); xmlDoc.Load(reader);