Saturday, May 5, 2012

XML Write using C#




using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;

namespace Examples
{
    public partial class XMLWrite : Form
    {
        public XMLWrite()
        {
            InitializeComponent();
        }

        XmlTextWriter w;
        private void XMLWrite_Load(object sender, EventArgs e)
        {
            w = new XmlTextWriter(@"E:\tutorials\asp.net+c#\demo\Examples\Examples\Student1.xml",null);
            w.WriteStartElement("Teacher");
            w.WriteStartElement("Name");
            w.WriteString("Student1");
            w.WriteEndElement();
            w.WriteEndElement();
            w.Close();
            MessageBox.Show(@"E:\tutorials\asp.net+c#\demo\Examples\Examples\Student1.xml written successfully");
            System.Diagnostics.Process.Start("iexplore", @"E:\tutorials\asp.net+c#\demo\Examples\Examples\Student1.xml");

        }
    }
}

No comments:

Using Authorization with Swagger in ASP.NET Core

 Create Solution like below LoginModel.cs using System.ComponentModel.DataAnnotations; namespace UsingAuthorizationWithSwagger.Models {     ...