欢迎来到金达范文网!

2023年C语言读取word文档方法(精选文档)

时间:2023-02-12 08:55:05 来源:金达范文网

第一种方法:复制代码代码如下:Response.ClearContent;Response.ClearHeaders;Response.ContentType=Applicat下面是小编为大家整理的2023年C语言读取word文档方法(精选文档),供大家参考。

2023年C语言读取word文档方法(精选文档)

   第一种方法:

  复制代码 代码如下:

  Response.ClearContent;

  Response.ClearHeaders;

  Response.ContentType = "Application/msword";

  string s=Server.MapPath"C#语言参考.doc";

  Response.WriteFile"C#语言参考.doc";

  Response.Writes;

  Response.Flush;

  Response.Close;

  第二种方法:

  复制代码 代码如下:

  Response.ClearContent;

  Response.ClearHeaders;

  Response.ContentType = "Application/msword";

  string strFilePath="";

  strFilePath =Server.MapPath"C#语言参考.doc";

  FileStream fs = new FileStreamstrFilePath,FileMode.OpenOrCreate,FileAccess.Read;

  Response.WriteFilestrFilePath,0,fs.Length;

  fs.Close;

  第三种方法:

  复制代码 代码如下:

  string path=Server.MapPath"C#语言参考.doc";

  FileInfo file=new FileInfopath;

  FileStream myfileStream=new FileStreampath,FileMode.Open,FileAccess.Read;

  byte[] filedata=new Byte[file.Length];

  myfileStream.Readfiledata,0,intfile.Length;

  myfileStream.Close;

  Response.Clear;

  Response.ContentType="application/msword";

  Response.AddHeader"Content-Disposition","attachment;filename=文件名.doc";

  Response.Flush;

  Response.BinaryWritefiledata;

  Response.End;

推荐访问:读取 语言 文档 C语言读取word文档方法 c语言读取word文档的方法 c语言读取word文档的方法有哪些 c语言读取word文档的方法是什么 c语言读取word文件内容

【2023年C语言读取word文档方法(精选文档)】相关文章:

1.农村党总支存在的问题举例(2篇)

2.农业技术推广服务项目实施方案(6篇)

3.军训典型事例描述(3篇)

4.内部控制规范与实际工作相结合(7篇)

5.写作能力不足自我批评(7篇)