In C#, is there a way to add an XML node to a file on disk WITHOUT loading it first?

前端 未结 8 1950
后悔当初
后悔当初 2020-12-20 14:14

I have a very basic XML structure/file on disk which is something like:


    kdkdkdk         


        
8条回答
  •  既然无缘
    2020-12-20 14:42

    Somehow, you'll have to read the XML file, since you cannot just add a node to the document.

    An Xml file can have only one root, so the new node will have to be added after the last data element, but, before the root closing tag. Otherwise the xml is not valid.

提交回复
热议问题