//1.读取html内容string htmlUrl = @"new/new.html";string htmlContent = string.Empty;using (StreamReader reader = new StreamReader(htmlUrl)){ htmlContent += reader.ReadToEnd();}//2.修改html内容string htmlContentNew = "新的html内容"; using (StreamWriter sw = new StreamWriter(url, false)){ sw.Write(htmlContentNew );}//3.修改xml文件XmlDocument xmlDoc = new XmlDocument();xmlDoc.Load(xmlpath);//修改节点-增加或删除或其他操作//修改后要保存到XML文件中using (XmlTextWriter xmlWriter=new XmlTextWriter(xmlpath,Encoding.UTF8)){ xmlDoc.WriteTo(xmlWriter);}
新闻热点
疑难解答