http://dotnet.aspx.cc/ShowDetail.aspx?id=CDBAB4E8-0938-4134-B86F-3B9E2C396E8D

解决方案 »

  1.   

    Dim S() As String = Split(pathURL, "\")
            Dim Filename As String = S(UBound(S))
            Dim DownUrl As String = "http://www.aa.net/document/" & Filename
            Dim myStringWebResource As String = DownUrl
            Dim myWebClient As New WebClient()        TextBox2.Text = "d:\" & Filename
            myWebClient.DownloadFile(myStringWebResource, TextBox2.Text)
            Label1.Text = "下载成功!"
      

  2.   

    一个方法,你可以调用/// <summary>
    /// 下载文件
    /// </summary>
    /// <param name="url">下载文件的URL</param>
    /// <param name="savePath">保存路径</param>
    /// <param name="saveFileName">保存文件名</param>
    public void download(string url, string savePath, string saveFileName) 
    {
    try 
    {
    System.Net.WebClient wc = new System.Net.WebClient();
    System.IO.FileInfo fs = new System.IO.FileInfo(System.IO.Path.Combine(savePath, saveFileName));
    wc.DownloadFile(url, fs.FullName);
    }
    catch{}
    }