62,074
社区成员
发帖
与我相关
我的任务
分享
routes.MapRoute(
"Download", // 路由名称
"Download/{filename}", // 带有参数的 URL
new { controller = "Download", name = "Download", action = "Index", filename = UrlParameter.Optional } // 参数默认值
);
public ActionResult Index(string filename)
{ string file = "d:\files\"+ filename;
return this.File(file, "application/octet-stream", filename);
}