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.
我该怎么做 XElement xml =empty;
使用 RemoveAll 方法删除所有子元素:
xml.RemoveAll();
这将使您保留现有的 XElement,但如果您也想清除它,只需完全创建一个新的 XElement。
xml = new XElement("name");