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 33 34 35 36 37
|
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.IO;
public struct strprofil
{
public string nom,prenom;
};
namespace ConsoleApplication2
{
public class Program
{
static void Main(string[] args)
{
int i=0;
strprofil[] profil = new profil[2];
XmlTextReader filexml = XmlTextReader("profil.xml");
filexml.WhitespaceHandling = WhitespaceHandling.None;
while (filexml.LocalName == "YZ")
{
profil[i].nom = filexml.ReadString();
filexml.Read();
profil[i].prenom = filexml.ReadString();
filexml.Read();
i += 1;
}
Console.WriteLine(" {0}", profil[0].nom);
Console.ReadLine();
}
}
} |
Partager