public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void download_Click(object sender, EventArgs e)
{
string url= "ftp://218.***.***.***/pig.jpg";
//string url = "D://ftp/pig.jpg";
HttpContext.Current.Session["pig"] = url;
Panel1.BackImageUrl = url;
Response.Write("<script>window.open('imageshow.aspx');</script>");
}
}
public partial class imageshow : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Image1.ImageUrl = HttpContext.Current.Session["pig"].ToString();
}
}
在default页中按钮按下,打开另一个页面显示.url为ftp服务器上图片的地址.直接就显示出来了.不过我只在自己电脑上试过,也没连数据库.改天找两台电脑试试