-4

How can I make the program continue its execution even if it crashes(Throws an exception).My current program works just fine if I manually press continue after the execution is thrown,so I want to make it continue the execution each time an exception is thrown.

6
  • 1
    I wish my software was like that... throwing exceptions and still work... Commented Aug 8, 2015 at 15:53
  • hahaa :D well,guess I'm just lucky.. Commented Aug 8, 2015 at 15:54
  • What kind of program is it? Console app, winform, wpf, service, asp.net? Commented Aug 8, 2015 at 15:54
  • 1
    Handle the exception... Commented Aug 8, 2015 at 15:54
  • 1
    I don't mean to be rude, but... Really? Commented Aug 8, 2015 at 17:17

1 Answer 1

3

Use the try-catch statement.

try { // Your code. } catch (Exception e) { // Handle the exception as you want or need. } 

More information

https://msdn.microsoft.com/en-us/library/0yd65esw(v=vs.120).aspx

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.