protected void Button1_Click(object sender, EventArgs e)
{
    string url = Server.MapPath("/img/image.png");
    FileInfo file = new FileInfo(url);
    Response.ContentType = "image/png";
    Response.AddHeader("Content-Disposition", "attachment; filename=" + HttpUtility.UrlEncode("优惠券.png", System.Text.Encoding.UTF8));
    Response.WriteFile(url);
    Response.Flush();
}

 

版权声明:本文为ZkbFighting原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/ZkbFighting/p/8603646.html