有关IE中直接打开word、excel、pdf等文档(是直接打开不需要下载提示,也不需要客户端修改IE安全设置) 如题有关IE中直接打开word、excel、pdf等文档(是直接打开不需要下载提示,也不需要客户端修改IE安全设置) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 直接打开.doc的url,或者设置Response.ContentType为word/application,然后再输出word内容excel/pdf也一样 FileInfo DownloadFile = new FileInfo("D:\\Distance Education\\Distance Education System\\WebSystem_V1.0\\Images\\UpLoad\\2009-03\\Courseware\\123.doc"); this.Response.Clear(); this.Response.ClearHeaders(); this.Response.Buffer = true; this.Response.ContentType = "word/application"; this.Response.AppendHeader("Content-Language", "zh"); this.Response.AppendHeader("Content-Disposition", "inline;filename=" + Server.UrlEncode("123.doc")); this.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312"); this.Response.AppendHeader("Content-Length", DownloadFile.Length.ToString()); this.Response.WriteFile(DownloadFile.FullName); this.Response.Flush(); this.Response.End();这是我以前写的代码,出来的是乱码 http://www.soidc.net/discuss/1/050119/09/313173_1.html 关注~好象需要浏览方有word才能在线预览的!! 加上这句话this.Response.AppendHeader("Content-Disposition", "inline;filename=123.doc");就没有下载提示的一定要inline如果一定要下载提示就改成“attachment;filename=123.doc就可以了 我很晕啊 帮不了你了 我加上这句话还是出现一个对话框 让我选择下载还是打开this.Response.ContentType = "word/application";跟this.Response.ContentType = "application/msword";没有有区别吧 jie3614 我这里也是有提示了晕死不知道什么原因 和服务器有关?需要修改mime type? 求助:想在foreach循环中实现一个功能 用ffmpeg给FLV视频加水印的源码 屏蔽datagridview的默认的右键菜单项(复制 粘贴等) sql server 2008 安装 failed ,请哪位大侠指点 求助!急!急!急!急!急!急!急!急!急!急!急!急!急!急!急!急!急!急! 线程的问题 创建远程消息队列路径的格式有问题??? 多线程中文件锁定的问题.希望大家帮忙.. 求助,那位大哥知道在VS2005里面用C#调用NetMeeting控件出这样的问题? 大家看看这得怎莫写 关于多人协作开发的问题!! 未将对象引用设置到对象的实例
FileInfo DownloadFile = new FileInfo("D:\\Distance Education\\Distance Education System\\WebSystem_V1.0\\Images\\UpLoad\\2009-03\\Courseware\\123.doc");
this.Response.Clear();
this.Response.ClearHeaders();
this.Response.Buffer = true;
this.Response.ContentType = "word/application";
this.Response.AppendHeader("Content-Language", "zh");
this.Response.AppendHeader("Content-Disposition", "inline;filename=" + Server.UrlEncode("123.doc"));
this.Response.ContentEncoding = System.Text.Encoding.GetEncoding("GB2312");
this.Response.AppendHeader("Content-Length", DownloadFile.Length.ToString());
this.Response.WriteFile(DownloadFile.FullName);
this.Response.Flush();
this.Response.End();这是我以前写的代码,出来的是乱码
this.Response.AppendHeader("Content-Disposition", "inline;filename=123.doc");
就没有下载提示的
一定要inline
如果一定要下载提示就改成“attachment;filename=123.doc
就可以了
我很晕啊 帮不了你了 我加上这句话还是出现一个对话框 让我选择下载还是打开this.Response.ContentType = "word/application";跟
this.Response.ContentType = "application/msword";没有有区别吧
我这里也是有提示了晕死不知道什么原因