【发布时间】:2011-12-04 17:04:36
【问题描述】:
有没有办法将图像从 .net Image Control 保存到服务器目录?
这是在 Page_Load 上生成的条形码图像:
Image1.ImageUrl = "~/app/barcode.aspx?code=TEST"
条形码图像在网页上显示得很好,但我也想将其保存到目录中:
~/barcode image/TEST.jpg
到目前为止,这是我所拥有的:
WebClient webClient = new WebClient();
string remote = Server.MapPath("..") + @"\app\barcode.aspx?code=TEST";
string local = Server.MapPath("..") + @"\barcode image\TEST.jpg";
webClient.DownloadFile(remote, local);
但它给了我一个错误:Illegal characters in path.
【问题讨论】: