Horje
XMLWriter write xml C# Code Example
XMLWriter write xml C#
using System;
using System.IO;
using System.Xml;

public class Sample
{
  public static void Main()
  {
     XmlTextWriter writer = new XmlTextWriter("Shopping_list.xml", null);

     //Write the root element
     writer.WriteStartElement("The_list");

     //Write sub-elements
     writer.WriteElementString("Fruit", "Banana");
     writer.WriteElementString("Vegetable", "Carrot");
     writer.WriteElementString("Drink", "Water");

     // end the root element
     writer.WriteEndElement();

     //Write the XML to file and close the writer
     writer.Close();
  }
}




Csharp

Related
ihttpactionresult to object c# Code Example ihttpactionresult to object c# Code Example
c# create console for winform Code Example c# create console for winform Code Example
pass datatable to stored procedure c# dapper Code Example pass datatable to stored procedure c# dapper Code Example
c# linq distinct group by nested list Code Example c# linq distinct group by nested list Code Example
audioSource unity Code Example audioSource unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8