/// <summary> /// 修改日志 /// </summary> /// <param name="name"></param> /// <param name="path"></param> public static void ModifyLog(string name, string path) { FileInfo fiXML = new FileInfo(path); if (fiXML.Exists) { XElement xelem = XElement.Load(path); var queryXml = from LoginLog in xelem.Descendants("msg_log") where LoginLog.Element("user").Value == "Admin" select LoginLog; foreach (XElement item in queryXml) { item.Element("user").Value = name; } } }