数据下载问题 各位兄弟,你们好?我们公司开发的是B/S架构,现在我要求把服务器的指定文件夹中的文件下载到客户端,怎样做?谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 /// <summary> /// 把服务器上的文件下载到客户端,在客户端出现另存为的对话框。 /// </summary> /// <param name="response">response对象</param> /// <param name="strAbsoluteFullPath">服务器上的文件,绝对路径,比如"C:\intput\wwwroot\test\测试.doc"</param> /// <param name="strUrlEncodeClientFileName">客户端另存为时,默认的文件名,比如"测试.doc",经url编码</param> public static void ClientDownload(System.Web.HttpResponse response, string strAbsoluteFullPath, string strUrlEncodeClientFileName) { System.IO.FileInfo File = new System.IO.FileInfo(strAbsoluteFullPath); response.Clear(); response.ClearHeaders(); response.Buffer = true; response.ContentEncoding = System.Text.UTF8Encoding.UTF8; response.AddHeader("Content-Disposition", "attachment;filename=" + strUrlEncodeClientFileName); response.AddHeader("Content-Length", File.Length.ToString()) ; response.ContentType = "application/octet-stream" ; response.WriteFile(File.FullName) ; response.Flush(); response.End() ; } 用vb.net编的语句是什么啊?哪位大虾知道?请不吝赐教小弟正急着用 是在vb.net下的asp.net 需要实现的是软件下载功能(就是点击一个按钮,然后实现链接软件下载)万分感谢! 用linq怎么操作list? GridView中怎么获取某一行的行数? table大小 登录老提示“密码错”,密码明明没错呀!!帮忙看看!谢谢! table状态的维持? 控件的焦点的问题???? 关于代理业务的系统功能流程,请大家帮小弟分析一下,小弟只有45分了. DataList中嵌套Repeater实现分类显示的问题,解决给分。谢谢 asp.net 上传问题 css在连接后发生变化,无法理解?? 高手进来看看,下面三句话,创建视图有没有问题 ASP。NET 怎样做交叉报表汇总??
/// <summary>
/// 把服务器上的文件下载到客户端,在客户端出现另存为的对话框。
/// </summary>
/// <param name="response">response对象</param>
/// <param name="strAbsoluteFullPath">服务器上的文件,绝对路径,比如"C:\intput\wwwroot\test\测试.doc"</param>
/// <param name="strUrlEncodeClientFileName">客户端另存为时,默认的文件名,比如"测试.doc",经url编码</param>
public static void ClientDownload(System.Web.HttpResponse response, string strAbsoluteFullPath, string strUrlEncodeClientFileName)
{
System.IO.FileInfo File = new System.IO.FileInfo(strAbsoluteFullPath);
response.Clear();
response.ClearHeaders();
response.Buffer = true;
response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
response.AddHeader("Content-Disposition", "attachment;filename=" + strUrlEncodeClientFileName);
response.AddHeader("Content-Length", File.Length.ToString()) ;
response.ContentType = "application/octet-stream" ;
response.WriteFile(File.FullName) ;
response.Flush();
response.End() ;
}
哪位大虾知道?请不吝赐教
小弟正急着用 是在vb.net下的asp.net 需要实现的是软件下载功能(就是点击一个按钮,然后实现链接软件下载)
万分感谢!