利用页面调用word文件其实非常简单:首先更改页面的显示方式,然后通过Response.WriteFile方法将word文件写入页面.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Response.ContentType = "Application/msword";
string filepath = Server.MapPath("~/11.doc");
Response.WriteFile(filepath);
Response.End();
}
}