C語言讀取word文檔的方法
來源:文萃谷 2.99W
第一種方法:
複製代碼 代碼如下:
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);
();