I have a List<> which I have managed to write into file.
Now I am trying to read the same file and write it back to List<>.
Is there a
I think the easiest way is to use the XmlSerializer:
XmlSerializer serializer = new XmlSerializer(typeof(List));
using(FileStream stream = File.OpenWrite("filename"))
{
List list = new List();
serializer.Serialize(stream, list);
}
using(FileStream stream = File.OpenRead("filename"))
{
List dezerializedList = (List)serializer.Deserialize(stream);
}