这个和读静态页面一样的处理,比如把百度首页的HTML保存在a.doc中可以这样做
WebRequest request = WebRequest.Create("http://www.baidu.com");
request.UseDefaultCredentials = false;
WebResponse response = request.GetResponse();
Stream resStream = response.GetResponseStream();
StreamReader sr = new StreamReader(resStream, System.Text.Encoding.Default);
File.AppendAllText(Server.MapPath("~/a.doc"), sr.ReadToEnd());
resStream.Close();
sr.Close();
File.Copy(System.Web.HttpContext.Current.Server.MapPath("a.html"),System.Web.HttpContext.Current.Server.MapPath("a.doc"));