write to an xml file

J

juli jul

Hello ,I am trying to do something like that in order to write content
of one xml file to other :

XmlDocument xml_new=new XmlDocument();
File.Copy(this.file_name,xml_new.Name);

But it fails,why?
Thank you!
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

If you simply need to copy one file to another ( no matter what kind of file
it's ) you do not need to open a new XmlDocument.

all you have to do is:
File.Copy( this.file_name, "c:\where_to_put_file");

cheers,
 
G

Guest

Hi Juli,

Try

XmlDocument Xml_New = new XMLDocument;

Xml_New.Load (your file name);

;)
hope this helps
Salva
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top