1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| using System;
using System.Linq;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Xml;
namespace AgentTest
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[MTAThread]
static void Main()
{
XmlDocument docxml = new XmlDocument();
//on crée le premier noeud avec les spécifications du document XML
XmlDeclaration declaration = docxml.CreateXmlDeclaration("1.0", "utf-8", "");
//On ajoute la déclaration au document
docxml.AppendChild(declaration);
//On crée le noeud racine du document
XmlNode racine = docxml.CreateNode(System.Xml.XmlNodeType.Element, "RapportKMS", "");
//On ajoute ce noeud au document
docxml.AppendChild(racine);
docxml.Save("RapportKMS.xml");
Application.Run(new AgentKMS());
}
}
} |
Partager