11,571 questions
Try to use XmlSerializer to do it.
static void Main(string[] args)
{
string path = @"C:\...\1.txt";
XmlSerializer serializer = new XmlSerializer(typeof(Page));
using (FileStream fileStream = new FileStream(path, FileMode.Open))
{
Page result = (Page)serializer.Deserialize(fileStream);
}
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.