日期:2014-05-18 浏览次数:20931 次
<Device Facility="SMIC-F8" Technology="1118C014.N7NOW" WaferSize="300" EdgeExclusion="3000" NotchExclusionWidth="12500" NotchExclusionHeight="3500" WaferConfigFile="SMIC-F8_1118C014.N7NOW_F781537B_20111104000000_wfcfg.xml" CreateDate="20111104000000" Orientation="270" ReticleOrientation="0" />
XDocument doc = new XDocument( new XDeclaration("1.0", "utf-8", "yes"), new XElement("Root", new XAttribute("attr1", "value"), new XAttribute("attr2", "value") ) ); Console.WriteLine(doc); using (StreamWriter sw = new StreamWriter(@"D:\test.xml")) { XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.IndentChars = " "; settings.NewLineOnAttributes = true; XmlWriter xmlWriter = XmlWriter.Create(sw, settings); doc.Save(xmlWriter); xmlWriter.Close(); }