help please

Getox

Well-known member
Joined
Jul 8, 2004
Messages
122
Im making a program that downloads images, but if the image didnt exist IE 404 Error, how would i stop the program from crashing and saying [ Continue | Exit ] ?

oh btw this is my code:
Code:
        Dim File1 As String = site.Text & "/dir1/test.gif"
        wclient.DownloadFile(File1, save.Text & "\dir1\test.gif")

but if that file dont exist, it does 404 and then my program crashed and asks to continue or exit..

please help.
 
Last edited by a moderator:
Getox said:
Im making a program that downloads images, but if the image didnt exist IE 404 Error, how would i stop the program from crashing and saying [ Continue | Exit ] ?

oh btw this is my code:
Code:
        Dim File1 As String = site.Text & "/dir1/test.gif"
        wclient.DownloadFile(File1, save.Text & "\dir1\test.gif")

but if that file dont exist, it does 404 and then my program crashed and asks to continue or exit..

please help.


Why not use a Try/Catch statement...http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmtrycatchfinally.asp
 
i dont want it to take me to the image i just want to know how to stop the program from crashing.
 
Back
Top