Quantcast
Browsing all 3 articles
Browse latest View live

Answer by Justin Niessner for Serialize class to XML?

If both of your classes were tagged with the [Serializable] attribute, then saving things to a file should be as simple as:var serializer = new XmlSerializer(typeof(Transport));using(var writer = new...

View Article


Answer by Smur for Serialize class to XML?

You need a stream and a XmlSerializer object, here's an example:FileStream fs = new FileStream(@"C:\MyPath", FileMode.OpenOrCreate);xmlSerializer = new...

View Article


Serialize class to XML?

I have the follow class and the list that holds it:public class Transport{ public string TransportType { get; set; } public string Mode { get; set; } public class Coordinates { public float ID { get;...

View Article
Browsing all 3 articles
Browse latest View live