'VB 2013 DownloadFile Error/Exception [closed]
Trying to use My.Computer.Network.DownloadFile to fetch a file from an FTP server in VB 2013 Express. Everything works great when the file is there. However, I am not able to capture the result when the file is not found. Using Try-Catch but it never hits the Catch. It brings up an "Unhandled exception has occurred in your application..." error.
Any help would be greatly appreciated!
Try
My.Computer.Network.DownloadFile(server_name, file_name, user_name, password, False, 500, True)
Catch ex As ArgumentException
MsgBox(ex.GetType().ToString())
Catch ex As TimeoutException
MsgBox(ex.GetType().ToString()) 'Label1.Text = ex
End Try
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
