public static void Ecrire_Log(string IP, string UserID, string Guid, string Fonction, string Information) { XDocument doc = XDocument.Parse(File.ReadAllText("C:\\xmllog.xml")); /* CFER_Log log = new CFER_Log() { IP = IP, UserID = UserID, Guid = Guid, Fonction = Fonction, Information = Information };*/ XElement XML_log = new XElement("logs", new XElement("IP", IP), new XElement("UserID", UserID), new XElement("Guid", Guid), new XElement("Fonction", Fonction), new XElement("Information", Information)); //XElement XML_log = new XElement("logs",IP, UserID, Guid, Fonction, Information); doc.Add(XML_log.Value.Replace(@"\n","").Replace(@"\n","")); doc.Save("C:\\xmllog.xml"); //XML_log.Save("c:\\xmllog.xml"); }