1 引用的命名空间
2 处理不同类型的文件
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
2 处理不同类型的文件
private void ShowPDF()
{
Response.ContentType = "Application/pdf";
string filePath = MapPath("Acrobat.pdf");
Response.WriteFile(filePath);
Response.End();
}
private void ShowWord()
{
Response.ContentType = "Application/msword";
string filePath = MapPath("Temp.doc");
Response.WriteFile(filePath);
Response.End();
}
private void ShowExcel()
{
Response.ContentType = "Application/x-msexcel";
string filePath = MapPath("最新通讯录(2008.12月版).xls");
Response.WriteFile(filePath);
Response.End();
}
pri