Answers for ".net serialize object to xml"

C#
1

c# serialize to xml

XmlSerializer xsSubmit = new XmlSerializer(typeof(MyObject));
 var subReq = new MyObject();
 var xml = "";

 using(var sww = new StringWriter())
 {
     using(XmlWriter writer = XmlWriter.Create(sww))
     {
         xsSubmit.Serialize(writer, subReq);
         xml = sww.ToString(); // Your XML
     }
 }
Posted by: Guest on August-03-2020

Code answers related to ".net serialize object to xml"

C# Answers by Framework

Browse Popular Code Answers by Language