在pageload事件下
Response.ContenType = "Application/pdf";
string FilePath = MapPath("acrobat.paf");
Response.WriteFile(FilePath);
Response.End();
如果为其他文件类型
ContenType = Text/html
image/gif
text/plain
image/jpeg
Application/msword(word文件)
Application/ X-msexcel(execl 文件)
Response.ContenType = "Application/pdf";
string FilePath = MapPath("acrobat.paf");
Response.WriteFile(FilePath);
Response.End();
如果为其他文件类型
ContenType = Text/html
image/gif
text/plain
image/jpeg
Application/msword(word文件)
Application/ X-msexcel(execl 文件)