连接直接写文件名就可以了阿..按钮:Response.Redirect("http://www.asc.com/exe.exe");

解决方案 »

  1.   

    用webclient实现,using System.net
          string remoteUri = "http://10.234.188.92/update/";
          string fileName = "swtest.txt", myStringWebResource = null;
          // Create a new WebClient instance.
          WebClient myWebClient = new WebClient();
          // Concatenate the domain with the Web resource filename.
          myStringWebResource = remoteUri + fileName;
          Console.WriteLine("Downloading File \"{0}\" from \"{1}\" .......\n\n", fileName, myStringWebResource);
          // Download the Web resource and save it into the current filesystem folder.
          myWebClient.DownloadFile(myStringWebResource,"c:\\"+fileName);      
          Console.WriteLine("Successfully Downloaded File \"{0}\" from \"{1}\"", fileName, myStringWebResource);
      

  2.   

    客户端只有IE,ASP.NET和C#开发环境都在服务器端,生成的文本文件都在服务器端。
      

  3.   

    SONGWAY朋友的源码应该是把其他URL的文件下到本地,我的意思是要把本地的文件下到客户端,但客户端只有IE,而且我想用C#+ASP.NET实现。
      

  4.   

    string URL = strSrcPath; 
    int n = URL.LastIndexOf('/'); 
    string URLAddress = URL;//.Substring(0,n); 
    string fileName = URL.Substring(n+1,URL.Length-n-1); 
    string Dir = strTargetPath; 
    string Path = Dir+'\\'+fileName;  try 

    WebRequest myre=WebRequest.Create(URLAddress); 

    catch(WebException exp) 

    return exp.Message; 
    }  try 

    //"开始下载文件..."; 
    client.DownloadFile(URLAddress,fileName); 
    Stream str = client.OpenRead(URLAddress); 
    StreamReader reader = new StreamReader(str); 
    byte[] mbyte = new byte[1000000]; 
    int allmybyte = (int)mbyte.Length; 
    int startmbyte = 0; 
    //"正在接收数据..."; 
    while(allmybyte>0) 

    int m = str.Read(mbyte,startmbyte,allmybyte); 
    if(m==0) 
    break;  startmbyte+=m; 
    allmybyte-=m; 
    }  FileStream fstr = new FileStream(Path,FileMode.OpenOrCreate ,FileAccess.Write); 
    fstr.Write(mbyte,0,startmbyte); 
    str.Close(); 
    fstr.Close(); 

    catch(WebException exp) 

    return exp.Message;  
    // ""; 
    }  return "";