Categories

Thousands of experts bid on your personal project at ScriptLance.com

create an XML file in C#

This example shows how to create an XML file in C#.

using System;
using System.Xml;

namespace ConsoleApplication3
{

class Class1
{

static void Main(string[] args)
{

string filename = @”d:\test.xml”;

XmlTextWriter textwriter = new XmlTextWriter(filename,null);

textwriter.Formatting = Formatting.Indented;
textwriter.WriteStartDocument();
textwriter.WriteStartElement(“links”);
textwriter.WriteStartElement(“category”,”programming”);
textwriter.WriteElementString(“address”,”www.progged.net”);
textwriter.WriteElementString(“description”,”programming site”);
textwriter.WriteEndElement();
textwriter.WriteEndElement();
textwriter.WriteEndDocument();
textwriter.Flush();
textwriter.Close();

}
}
}

Bookmark It

Hide Sites

$$(‘div.d6′).each( function(e) { e.visualEffect(’slide_up’,{duration:0.5}) });