1
기존에 쓰기 :그것은 다음과 같이 보입니다, 나는 XML 파일을 XML 파일
<?xml version="1.0" encoding="utf-8"?>
<Settings>
<WhereDoCopy Path="C:\Users\USER\Desktop\jobs" />
</Settings>
내가 그 파일에 요소를 추가 할 수 있습니까?
기존에 쓰기 :그것은 다음과 같이 보입니다, 나는 XML 파일을 XML 파일
<?xml version="1.0" encoding="utf-8"?>
<Settings>
<WhereDoCopy Path="C:\Users\USER\Desktop\jobs" />
</Settings>
내가 그 파일에 요소를 추가 할 수 있습니까?
XDocument doc = XDocument.Load("your.xml");
XElement item = new XElement(WhereDoCopy ,
new XAttribute("Path", "C:\Users\USER\Desktop\jobs2"));
doc.Root.Add(item);
http://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument.aspx
"C 번호"와 제목을 접두사하지 마십시오 - 그것이 우리가 여기에 태그를 사용하여 무엇 [SO]. –