Catch and discard the exception. At its simplest:
try
{
// do your stuff here.
}
catch ( SomeExpectedTyp eOfException e )
{
// but don't do anything with it.
}
It would be wise to explicitly catch and discard only the specific exception
types you're willing to ignore. Other types of exceptions might be
legitimate, and you may want to catch them as well and handle them in other
ways (a Permissions exception, for instance, is a show-stopper). But there's
no reason why you can't continue processing in your method, regardless of
the exceptions you catch, as long as you don't rethrow the exception in the
catch block. Remember to order your catch clauses in order of most-specific
exception type to least specific.
HTH,
Tom Dacon
Dacon Software Consulting
"Antipode" <An******@discu ssions.microsof t.com> wrote in message
news:05******** *************** ***********@mic rosoft.com...
Hi,
I'm writing a simple application that deletes multiple directories. I
want to write it so that it will simply continue on through the list of
directories if an exception is thrown (the directory is not there). Is
there a way to do this? Am I approaching this all wrong?