其中filePath是要读取的xml文件路径
T obj = default(T); using (IsolatedStorageFileStream istream = new IsolatedStorageFileStream(filePath, FileMode.Open, storageFile)) using (XmlReader reader = XmlReader.Create(istream)) { XmlSerializer serializer = new XmlSerializer(typeof(T)); obj = (T)serializer.Deserialize(reader); }