I try to download some files from sourceforge.net, it works fine for most of the files, but I really don't find my mistake here:
Hope someone here may help me with that.
I cannot understand why I can download it with browser but not with vb.net, and I also dont understand why it works for the first file...
Kind regards,
zeha
VB.NET:
Public Class Form1
Public WithEvents WebClient1 As New Net.WebClient
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim URLPart1$ = "http://downloads.sourceforge.net/portableapps/"
Dim FileName1$ = "FirefoxPortableTest_17.0_Beta_3_English.paf.exe"
WebClient1.DownloadFile(New Uri(URLPart1 & FileName1), "D:\" & FileName1)
Dim FileName2$ = "FirefoxPortable_16.0.2_English.paf.exe"
Try
WebClient1.DownloadFile(New Uri(URLPart1 & FileName2), "D:\" & FileName2)
'Works in Browser - w/o 404: http://downloads.sourceforge.net/portableapps/FirefoxPortable_16.0.2_English.paf.exe why it won't work here?
Catch ex As Exception
MsgBox(URLPart1 & FileName2 & vbNewLine & vbNewLine & ex.ToString)
End Try
End Sub
End Class
Hope someone here may help me with that.
I cannot understand why I can download it with browser but not with vb.net, and I also dont understand why it works for the first file...
Kind regards,
zeha