exception....help

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know i can catch an exception.... but is there a way to loop.... i mean to
repeat a task until the exception is not happeneing example:

i am using webrequest to retrieve an image

i want to catch the exception if the URL is not valid but i want to repeat
the question for the IP until a valid one is supplied.....

Pls help
 
I know i can catch an exception.... but is there a way to loop.... i mean to
repeat a task until the exception is not happeneing example:

i am using webrequest to retrieve an image

i want to catch the exception if the URL is not valid but i want to repeat
the question for the IP until a valid one is supplied.....

boolean done=false
while (!done)
{
try
{
getIP();
done=true
}
catch (Exception e)
{}
}
 
Back
Top