Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

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:

       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.

Edited by Getox

Page Edit 2.0 Alpha 2 OUT NOW!

- Download Now -

Posted
Im making a program that downloads images' date=' 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:

       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

-Sean

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...