Daha önce "XMLWriter" kullanma önerisi için teşekkürler, her defasında yeni xml dosyası oluşturduğundan, xmldoc dosyasını yüklemek için xmldoc kullandım, sonra bu dosyaya ekleyelim, kodum budur ama istisna atar " Bu belgede zaten bir 'DocumentElement' düğümü var. Burada xmlwriter'i kullanarak xml dosyasını ekle
//Append to xml file
XmlDocument doc = new XmlDocument();
doc.Load(@"c:\\test.xml");
using (XmlWriter xmlWrite = doc.CreateNavigator().AppendChild())
{
xmlWrite.WriteStartElement("image name=",Name);
xmlWrite.WriteElementString("width", widthValue[1]);
xmlWrite.WriteElementString("Height", heightValue[1]);
xmlWrite.WriteElementString("file-size", FileSizeValue[1]);
xmlWrite.WriteElementString("file-format", FileFormatValue[1]);
xmlWrite.WriteElementString("resolution", ResolutionValue[1]);
xmlWrite.Close();
}
Örneğim test.xml olduğunu
<job-metadata>
<slug>730s_Sales/CupWinner_0111</slug>
<locations>Africa</locations>
<primary-location>Africa</primary-location>
<reporter>Leigh Sales</reporter>
<genre>Current</genre>
<copyright>CBS</copyright>
<autopublish>true</autopublish>
</job-metadata>
Am XML verileriyle oynamak için Advance
yılında<job-metadata>
<slug>730s_Sales/CupWinner_0111</slug>
<locations>Africa</locations>
<primary-location>Africa</primary-location>
<reporter>Leigh Sales</reporter>
<genre>Current</genre>
<copyright>CBS</copyright>
<autopublish>true</autopublish>
- <image name="557684_20111101-730s_SalesCupWinner_0111_80x60.jpg">
<width>80</width>
<height>60</height>
<file-size>7045</file-size>
<file-format>JPEG Baseline</file-format>
<resolution>72</resolution>
<custom-name>newsthumbnail</custom-name>
</image>
</job-metadata>
aşağıda teşekkür gibi xml
yararlı olduğunu Sen result'll böyle olmak bu
gibi bir şey yapmanız gereken bu
gibi uemnt? ................. –
Kesinlikle, çok teşekkürler, henüz değiştirmedim, yıldız olacağım Şimdi bir tane yazıyorum. Kodu buraya geri göndereceğim. Tekrar teşekkürler – Usher