第一种方法:
复制代码 代码如下:
rContent();
rHeaders();
entType = "application/msword";
string s=Server.MapPath("C#语言参考");
eFile("C#语言参考");
e(s);
h();
e();
第二种方法:
复制代码 代码如下:
rContent();
rHeaders();
entType = "Application/msword";
string strFilePath="";
strFilePath =Server.MapPath("C#语言参考");
FileStream fs = new FileStream(strFilePath,OrCreate,);
eFile(strFilePath,0,th);
e();
第三种方法:
复制代码 代码如下:
string path=Server.MapPath("C#语言参考");
FileInfo file=new FileInfo(path);
FileStream myfileStream=new FileStream(path,,);
byte[] filedata=new Byte[th];
(filedata,0,(int)(th));
e();
r();
entType="application/msword";
eader("Content-Disposition","attachment;filename=文件名");
h();
ryWrite(filedata);
();