Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 XmlDocument,我想将内容(OuterXml)作为一个漂亮的打印字符串。我怎样才能做到这一点?
问候
假设我理解正确
using System.Xml.Linq; XDocument xDoc = XDocument.Load(@".....\test.xml"); string xDocString = xDoc.ToString(SaveOptions.None);