我知道服务器上图片的IP(http://168.168.21.88/tpk/2006.04.15.jpg)地址,现在想下载到客户端,需要在下载时弹出保存窗口来选择保存路径!请问如何实现???测试通过马上结帖!!!
WebClient wc = new WebClient();
wc.DownloadFile("http://168.168.21.88/tpk/2006.04.15.jpg","D:\\down\\2006.04.15.jpg");
我用这种方法只能下载到服务器的硬盘上("D:\\down\\2006.04.15.jpg"这个不知道如何改成客户端地址或者任意的地址),而且还没有提示窗口,请问大家有什么好方法来改进啊!

解决方案 »

  1.   

    Response.Clear(); 
    Response.Buffer= true;
    Response.Charset="GB2312";    
    Response.AppendHeader("Content-Disposition","attachment;filename=2006.04.15.jpg"); 
    Response.ContentEncoding=System.Text.Encoding.GetEncoding("GB2312");
    Response.ContentType = "application/octet-stream";
    this.EnableViewState = false;    
    System.Globalization.CultureInfo myCItrad = new System.Globalization.CultureInfo("ZH-CN",true);
    System.IO.StringWriter oStringWriter = new System.IO.StringWriter(myCItrad); 
    System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
    this.Image1.RenderControl(oHtmlTextWriter); 
    Response.Write(oStringWriter.ToString());
    Response.End();为什么这样下载下来的图片打不开呢,而且图片很小,好象是下载不完全啊!
      

  2.   

    图片数据也能存成string格式???应该用byte[]吧
      

  3.   

    http://dev.csdn.net/develop/article/23/23056.shtm
    楼主写到Response里来下载是可以,下载video都可以,图片没问题,再改改你那个方法
      

  4.   

    sorry,前面没看清, 不能把图片的ip地址暴露给客户端让它自己去下吗