Skip to content

Instantly share code, notes, and snippets.

@sudarshanReddykurri
Created August 7, 2017 10:41
Show Gist options
  • Save sudarshanReddykurri/46e4fd728f53b3688d2611b6625c94d1 to your computer and use it in GitHub Desktop.
Save sudarshanReddykurri/46e4fd728f53b3688d2611b6625c94d1 to your computer and use it in GitHub Desktop.
xml serialization and deserialisation in c#
private void Serealization()
{
// serealisation data to xml
using (Stream writer = new FileStream("Config.xml", FileMode.Create))
{
XmlSerializer serializer = new XmlSerializer(typeof(List<AppToLaunch>));
serializer.Serialize(writer, appManager);
}
}
private void Deserealization()
{
using (Stream stream = new FileStream("Config.xml", FileMode.Open))
{
XmlSerializer serializer = new XmlSerializer(typeof(List<AppToLaunch>));
appManager = (List<AppToLaunch>)serializer.Deserialize(stream);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment