private void DelImage( string pID) { //update xml System.Xml.XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load(fileUrl); XmlNode node = xmlDoc.SelectSingleNode("/album/folder/photoes/photo[guid='" + pID + "']"); node.ParentNode.RemoveChild(node); //good method!!! xmlDoc.Save(fileUrl); //del the file } 转载于:https://www.cnblogs.com/silva/archive/2006/03/02/341237.html