using System;
usingSystem.Collections.Generic;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingSystem.Xml;
using System.IO;
namespace ConsoleApplication1
{
classPR7A
{
staticvoid Main(string[] args)
{
XmlTextWriterwr = newXmlTextWriter("Books.xml",null);
wr.WriteStartElement("Books");
wr.WriteElementString("id", "01");
wr.WriteElementString("title", "intro to c");
wr.WriteElementString("price", "450");
wr.WriteElementString("id", "02");
wr.WriteElementString("title", "Operating System");
wr.WriteElementString("price", "650");
wr.WriteElementString("id", "03");
wr.WriteElementString("title", "begining DOt.Net");
wr.WriteElementString("price", "750");
wr.WriteEndElement();
wr.Close();
Console.Write("xml created");
Console.ReadLine();
}
}
}
OUTPUT:
0 Comments