using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 
{
   
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            if (FileUpload1.HasFile)
            {
                FileUpload1.SaveAs(Server.MapPath(FileUpload1.FileName));
                Session ["imagename"] = FileUpload1.FileName;
                Label4.Text = "上传图像提示信息：  上传成功！";
            }
        }
        catch
        {
            Label4.Text = "上传图像提示信息：  上传失败！";
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Image1.ImageUrl = Session["imagename"].ToString ();
    }
}
