帖子有附件, 如何调用本地相对应的程序打开附件, 输出文件类型和文件,ie会自动调用客户端的程序打开。你问毛毛雨,他做过。你发短消息给他。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你附件的超连接指向一个新的页面,传一个File参数给它 在这个新页面的page_load 中写以下代码 string path = Server.MapPath(Request.Params["File"]);//File为你的附件路径 System.IO.FileInfo file = new System.IO.FileInfo(path); Response.Clear(); Response.AddHeader("Content-Disposition", "attachment; filename=" +file.Name); Response.AddHeader("Content-Length", file.Length.ToString()); Response.ContentType = "application/octet-stream"; Response.WriteFile(file.FullName); Response.End(); context.Server.Execute 执行跳转报错 关于sql语句单'号的问题 js跨域问题 求算法【排序】 大家进来讨论一下这个系统 真它X的郁闷问题 抓取页面的内容 在线广播如何制作 DataGrid不能更新供应商成交单数据.... gridview验证问题 技术问题 DataGrid的页眉怎样能做成不规则的两行
在这个新页面的page_load 中写以下代码
string path = Server.MapPath(Request.Params["File"]);//File为你的附件路径
System.IO.FileInfo file = new System.IO.FileInfo(path);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" +file.Name);
Response.AddHeader("Content-Length", file.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(file.FullName);
Response.End();