Created
August 7, 2017 10:41
-
-
Save sudarshanReddykurri/46e4fd728f53b3688d2611b6625c94d1 to your computer and use it in GitHub Desktop.
xml serialization and deserialisation in c#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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