Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Created March 18, 2025 17:12
Show Gist options
  • Save dontpaniclabsgists/07da20a98427bb2d0cdbdd823ddbd61d to your computer and use it in GitHub Desktop.
Save dontpaniclabsgists/07da20a98427bb2d0cdbdd823ddbd61d to your computer and use it in GitHub Desktop.
using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
public static void SerializeAndPrint()
{
XmlSerializer serializer = new XmlSerializer(typeof(Person));
using (StringWriter writer = new StringWriter())
{
serializer.Serialize(writer, person);
Console.WriteLine(writer.ToString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment