保存文件时弹出选择路径框 如题,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SaveFileDialog saveFileDialog1 = new SaveFileDialog(); //设置文件类型 saveFileDialog1.Filter = " txt files(*.txt)|*.txt|All files(*.*)|*.*"; //点了保存按钮进入 if (saveFileDialog1.ShowDialog() == DialogResult.OK) { //获得文件路径 //localFilePath = saveFileDialog1.FileName.ToString(); //保存文件 } 输出文件实现下载string path = Server.MapPath("~/") + "";Response.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(FileName, System.Text.Encoding.GetEncoding("utf-8")) );Response.ContentType = "application/octet-stream";Response.WriteFile("" + path + "");Response.End(); asp.net动态生成日期如何搞? 面试题,看我多操蛋。。。。 谁有浮动的flash对联广告的代码??急急 Frameset在ASP.NET2.0使用的问题,请高手指点。 URL 正则表达式问题 直接编辑table的问题 怎样才能在项目中使用Enterprise Library2.0 关于生成aspx生成htm的问题(讨论有分) 使用ajaxpro后的server.mappath() 求助,想把提交页面的数据用同一个存储过程保存到两个表中怎么做? 一个关于RadiobuttonList的问题 动网篮坛,模拟登录,并将cookie写入浏览器
//设置文件类型
saveFileDialog1.Filter = " txt files(*.txt)|*.txt|All files(*.*)|*.*";
//点了保存按钮进入
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
//获得文件路径
//localFilePath = saveFileDialog1.FileName.ToString(); //保存文件
}
string path = Server.MapPath("~/") + "";
Response.AppendHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(FileName, System.Text.Encoding.GetEncoding("utf-8")) );
Response.ContentType = "application/octet-stream";
Response.WriteFile("" + path + "");
Response.End();