Reputation: 219
I am trying to copy contents of one xml file into another xml file. I found many examples where copying nodes is done but could not find how to just copy all the content.
Is this possible at all? If so can you please provide some direction.
Thanks
Edit: I want to create this new xml file in the location dynamically supplied by the application's text box.
Thanks again.
Upvotes: 1
Views: 6055
Reputation: 1129
As a file:
string sourcefile = "somefile.xml";
string destinationfile = "anotherFile.xml";
System.IO.File.Copy(sourcefile, destinationfile);
Upvotes: 3
Reputation: 54734
If you want to replace one XML file with another, why not use File.Copy
?
Upvotes: 5