Writing formatted XML with XmlWriter

前端 未结 4 1682
臣服心动
臣服心动 2021-01-07 23:31

I\'m trying to write to an XML file to the isolated storage but I would like to format it like this:-


  

        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-07 23:59

    You can customize the xml output via the XmlWriterSettings.

    You didn't include any code, but you can set the XmlWriterSettings when you create the XmlWriter. You can also just use something like:

    var myXmlWriter = new XmlWriterSettings { Indent = true };
    

提交回复
热议问题