How to show Xml data in the winform in the XML fashion?

前端 未结 3 1664
甜味超标
甜味超标 2021-02-08 10:57

My winform application communicates with the web service. For some requirement, I need to present the web service response in the XML format in the winform application.

3条回答
  •  有刺的猬
    2021-02-08 12:03

    Try to apply indent to the xmlText, like:

    XDocument xDocument = XDocument.Parse(xmlText);
    myRichTextBox.Text = xDocument.ToString();//ToString will format xml string with indent
    //as XDocument class overrides ToString and return xml with indent
    

提交回复
热议问题