Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create XML file ?
Message
Information générale
Forum:
ASP.NET
Catégorie:
Développement mobile
Divers
Thread ID:
00767870
Message ID:
00767900
Vues:
7
Can someone give me a direction or a small sample code (in C# or VB .NET) for the following:

I have a simple web page (ASP.NET) which has 2 or 3 textboxes. When user clicks on Submit button I want to add values from the text boxes to an XML file. If you know of a white paper or a article which describes how to do what I want, please let me know.


Here something to get you started - just cut and paste onto a console app:
using System;
using System.Xml;

// Console Application
class XMLSample
{
     static void Main()
     {
          XmlDocument oXml = new XmlDocument();
          XmlElement oRoot = oXml.CreateElement("RootNode");
          oXml.AppendChild(oRoot);
          for(int i=1;i<10;i++)
          {
               XmlElement oChild = oXml.CreateElement("ChildNode");
               oChild.InnerText = "The text between the tags";
               oRoot.AppendChild(oChild);
          }
          
          Console.WriteLine(oRoot.OuterXml);
     }
}
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform