fileupload的使用
string bknc = txt_bknc.Text.Trim();
string bksm = txt_bksm.Text.Trim();
//int uid = Session["uid"].ToString();
//图片路径
string Imageurl = string.Empty;
string formerpic = string.Empty;
string newName = string.Empty;
if (this.FileUpload1.HasFile)
{
string filename = this.FileUpload1.FileName;
//获取大小和后缀名
string hz = filename.Substring(filename.LastIndexOf('.') + 1).ToLower();
int imagesize = this.FileUpload1.PostedFile.ContentLength;
newName = DateTime.Now.Second.ToString() + "_" + imagesize.ToString() + "." + hz;
if (this.imgfw.ImageUrl != "img/touxiang/wuzhaopian.gif")
{
if (hz == "jpg" && imagesize < 3000000)
{
//获取服务器目录
Imageurl = Page.MapPath("img/touxiang/" + newName);
this.FileUpload1.SaveAs(Imageurl);
//原图
formerpic = GetImageUrl(this.imgfw.ImageUrl);
File.Delete(Server.MapPath("img/touxiang/" + formerpic));
}
else
{
Common.Show(this.Page, "图片后缀错误或图片大小过大");
newName = string.Empty;
}
}
怎么获取formerpic的值