How to create a XmlDocument using XmlWriter in .NET?

前端 未结 5 1268
傲寒
傲寒 2020-12-08 02:00

Many .NET functions use XmlWriter to output/generate xml. Outputting to a file/string/memory is a very operation:

XmlWriter xw = XmlWriter.Create(PutYourStre         


        
5条回答
  •  萌比男神i
    2020-12-08 02:34

    There is an underlying Stream object that the XmlWriter was writing to, if it was bidirectional (MemoryStream), you could simply re-position it back to -0- and then use the Stream object in the XmlDocument.Load(stream).

    HTH,

    Z

提交回复
热议问题