XDocument.Save to specific directory?

Posted by Ignacio on Stack Overflow See other posts from Stack Overflow or by Ignacio
Published on 2010-04-20T18:01:47Z Indexed on 2010/04/20 18:23 UTC
Read the original article Hit count: 202

Filed under:
|

Hi, I'm using this XML classes for the first time and can't find this piece of info.

I'm doing:

xmlDoc = new XDocument(new XDeclaration("1.0", "utf-8", "yes"));
xmlDoc.Add(new XElement("Images"));
xmlDoc .Save("C:\\Backup\\images.xml");

But doesn't work. It only works if I use just the filename, like "images.xml", but of course, the file gets saved on the execution path.

© Stack Overflow or respective owner

Related posts about c#

Related posts about Xml