标签:
1 //读取html内容 2 string htmlUrl = @"new\new.html"; 3 string htmlContent = string.Empty; 4 using (StreamReader reader = new StreamReader(htmlUrl)) 5 { 6 htmlContent += reader.ReadToEnd(); 7 } 8 9 //修改html内容 10 string htmlContentNew = "新的html内容"; 11 using (StreamWriter sw = new StreamWriter(url, false)) 12 { 13 sw.Write(htmlContentNew ); 14 }
标签:
原文地址:http://www.cnblogs.com/zhyue93/p/System_IO.html