XML DeSerialize - Possible to Trap Extra XML in File?
问题 Is there a way to trap the extra XML tags in a file that you did not anticipate in your class? For Example: using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Xml.Serialization; namespace XmlDeserializerTest { class Program { static void Main(string[] args) { XmlSerializer deserializer = new XmlSerializer(typeof(PersonInfo)); StreamReader reader = new StreamReader(@"C:\XML\Xml.xml"); object obj = deserializer.Deserialize(reader)