将doc文件输入到内存流中

FileStream fileStream=new FileStream(pFileName,FileMode.Open)
long fileSize = fileStream.Length;
Context.Response.ContentType="application/msword";
Context.Response.AddHeader("Content-Length",fileSize.ToString());
byte[] fileBuffer=new byte[fileSize];
fileStream.Read(fileBuffer, 0, (int)fileSize);
Context.Response.BinaryWrite(fileBuffer);
Context.Response.End();
posted @ 2005-11-02 11:00  Benny Ng  阅读(236)  评论(0编辑  收藏  举报