读取网页页面代码 并保存
//使用空间 using System.Net; using System.IO; if (!IsPostBack) { WebClient client = new WebClient(); string reply = client.DownloadString("http://www.sina.com"); TextArea1.Value = reply; } FileStream fs = new FileStream(@"c:/aa.html", File
//使用空间
using System.Net;
using System.IO;
if (!IsPostBack)
{
WebClient client = new WebClient();
string reply = client.DownloadString("http://www.sina.com");
TextArea1.Value = reply;
}
FileStream fs = new FileStream(@"c:/aa.html", FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(fs, System.Text.Encoding.UTF8);
sw.Write(TextArea1.Value);
sw.Close();
fs.Close();
上一篇: js 动态生成html 触发事件传参字符转义的实例
下一篇: ThinkPHP处理Ajax返回的方法