62,242
社区成员




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);
}