当前位置:首页 > 问答大全 > 如何获取img中图片的数据

如何获取img中图片的数据

被浏览: 0次 2023年09月18日 15:18
热门回答(1个)
游客1

用FileUpload上传:
获得到:string imgName = this.FileUploadPhoto.FileName.ToString();
if (imgName == null || imgName.Equals(""))
{
Response.Write("");
}else
{
this.FileUploadPhoto.SaveAs(Server.MapPath("~/Admin/fileImage/" + imgName));
string dbasePath = imgName; /拍基/敬贺胡"~\\Admin\\fileImage\亮拦\" + imgName;
cp.cImage = dbasePath;//图片路径
调用插入方法
}

页面imgae: ImageUrl='<%# getImage((Eval("cImage")).ToString()) %>'
public string getImage(string image)
{
return "Admin/fileImage/" + image;
}