首页 > Web开发 > 详细

保存网页上的图片到本地

时间:2018-03-19 18:01:40      阅读:163      评论:0      收藏:0      [点我收藏+]

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

保存网页上的图片到本地

原文:https://www.cnblogs.com/ZkbFighting/p/8603646.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!