XmlDeserialization

Settembre 14th, 2007

Description: Deserializer of an xml file into a class

Link: http://www.codekeep.net/snippets/a783355a-14a7-46ed-9c0f-6d06a23d32cc.aspx

XmlSerializer s = new XmlSerializer( typeof( ShoppingList ) );

// Deserialization
        ShoppingList newList;
        TextReader r = new StreamReader("list.xml");
        newList = (ShoppingList)s.Deserialize(r);
        r.Close();

  • .NET
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.