C语言读取word文档的方法
第一种方法:
复制代码代码如下:
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = Application/msword;
string s=Server.MapPath(C#语言参考.doc);
Response.WriteFile(C#语言参考.doc);
Response.Write(s);
Response.Flush();
Response.Close();
第二种方法:
复制代码代码如下:
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = Application/msword;
string strFilePath=;
strFilePath =Server.MapPath(C#语言参考.doc);
FileStream fs = new FileStream(strFilePath,FileMode.OpenOrCreate,FileAccess.Read);
Response.WriteFile(strFilePath,0,fs.Length);
fs.Close();