Created
August 24, 2012 05:57
-
-
Save fresky/3446193 to your computer and use it in GitHub Desktop.
WriteXML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XmlWriterSettings xws = new XmlWriterSettings | |
{ | |
OmitXmlDeclaration = true, | |
Indent = true | |
}; | |
XDocument doc; | |
using (XmlWriter xw = XmlWriter.Create(new StreamWriter(@"D: est.xml"), xws)) | |
{ | |
doc = new XDocument( | |
new XElement("GarbageCanList", | |
new XElement("GarbageCan", | |
new XElement("Name", "name1"), | |
new XElement("Regex", "reg1"), | |
new XElement("Include", "Include1"), | |
new XElement("Exclude", "Exclude1"), | |
new XElement("File", true), | |
new XElement("Directory", false) | |
) | |
) | |
); | |
doc.Save(xw); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
XmlWriterSettings xws = new XmlWriterSettings | |
{ | |
OmitXmlDeclaration = true, | |
Indent = true | |
}; | |
XDocument doc; | |
using (XmlWriter xw = XmlWriter.Create(new StreamWriter(@"D: est.xml"), xws)) | |
{ | |
doc = new XDocument( | |
new XElement("GarbageCanList", | |
new XElement("GarbageCan", | |
new XElement("Name", "name1"), | |
new XElement("Regex", "reg1"), | |
new XElement("Include", "Include1"), | |
new XElement("Exclude", "Exclude1"), | |
new XElement("File", true), | |
new XElement("Directory", false) | |
) | |
) | |
); | |
doc.Save(xw); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment