将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();

转载于:https://www.cnblogs.com/miaomiaoga/archive/2005/11/02/266977.html

你可能感兴趣的:(python,c/c++)