网站首页 语言 会计 互联网计算机 医学 学历 职场 文艺体育 范文
当前位置:学识谷 > 计算机 > C语言

C语言读取word文档的方法

栏目: C语言 / 发布于: / 人气:2.94W

 第一种方法:

C语言读取word文档的方法

复制代码 代码如下:

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

();