使用vb.net或C下载文件

使用vb.net或C下载文件,vb.net,download,Vb.net,Download,此代码允许我使用vb.net从internet下载文件: If My.Computer.Network.IsAvailable Then DownloadClient = New WebClient Dim Url As New Uri("http://www.domain.com/download") DownloadClient.DownloadFileAsync(Url,"C:\file.ext") End If 但问题是,有时链接需要重定向到下载文件的链接,因此有没有

此代码允许我使用vb.net从internet下载文件:

If My.Computer.Network.IsAvailable Then
   DownloadClient = New WebClient
   Dim Url As New Uri("http://www.domain.com/download")
   DownloadClient.DownloadFileAsync(Url,"C:\file.ext")
End If
但问题是,有时链接需要重定向到下载文件的链接,因此有没有办法获取下载文件的名称以使用它来代替file.ext!谢谢: