public static void ErrorRenameXML(System.Xml.XmlDocument doc, string sXMLFilename, string sError, CarverLabUtility.Logger log, bool bDeleteOriginal) { log.WriteLog(sError); System.IO.FileInfo fi = new System.IO.FileInfo(sXMLFilename); fi.MoveTo(System.IO.Path.ChangeExtension(fi.FullName,".err")); //System.IO.File.Move(sXMLFilename,sXMLFilename + ".err"); // log.WriteLog(" Renaming XML file..."); //if (doc == null) //{ // doc = new System.Xml.XmlDocument(); // doc.Load(sXMLFilename); //} /* System.Xml.XmlElement elt = doc.CreateElement("ENCODEERROR"); elt.InnerText = sError; doc.DocumentElement.AppendChild(elt); */ //doc.Save(sXMLFilename + ".err"); //if (bDeleteOriginal) // System.IO.File.Delete(sXMLFilename); log.WriteLog(" XML file copied or renamed to: " + sXMLFilename + ".err"); }