How to resume a hang console job due to lost network connection after the network connection is restored

I wrote a console application that generates the reports in PDF format and exports the reports to a network share folder.  The job is written in VB.NET 2005 and scheduled to run every 2 hours.

Whenever the network connection was lost, the job will be hang until I acknowledge the error manually. Is there a way to resume the job automatically when the network connection is restored?  I used try catch clause in the code to catch the error and email the error to myself, but the email didn't send out neither due to the metwork problem.  

Thanks for help
Who is Participating?
CodeCruiserConnect With a Mentor Commented:
You can use the try catch block to handle the error even if the email can not be sent. Just put the code in try catch blocks and within the catch block, make the thread sleep for a second and then try again.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.