XmlWriter to Write to a String Instead of to a File

前端 未结 6 2037
星月不相逢
星月不相逢 2020-11-27 03:59

I have a WCF service that needs to return a string of XML. But it seems like the writer only wants to build up a file, not a string. I tried:

string nextXM         


        
6条回答
  •  天命终不由人
    2020-11-27 04:36

    Guys don't forget to call xmlWriter.Close() and xmlWriter.Dispose() or else your string won't finish creating. It will just be an empty string

提交回复
热议问题