Prevent XmlSerializer from formatting output

前端 未结 3 1864
长情又很酷
长情又很酷 2020-12-20 11:26

When using the default settings with the XmlSerializer it will output the XML as a formated value.

IE: something along these lines.



        
3条回答
  •  情书的邮戳
    2020-12-20 11:46

    ..

    XmlSerializer xmlser = new XmlSerializer(...);
    
    XmlWriterSettings settings = new XmlWriterSettings {Indent = false};
    
    using (XmlWriter xw = XmlWriter.Create(stream, settings))
    {
    

    ...

提交回复
热议问题