using System.IO;
using System.Runtime.Serialization;
namespace Zuga.net
{
[DataContract]
public class President
{
[DataMember] public int Number { get; set; }
[DataMember] public string First { get; set; }
[DataMember] public string Last { get; set; }
[DataMember] public int Year { get; set; }
}
class Program
{
static void Main(string[] args)
{
var serializer = new DataContractSerializer(typeof(President));
var path = "president.xml";
using (var fs = new FileStream(path, FileMode.Open))
{
var president = (President)serializer.ReadObject(fs);
}
}
}
}