C# try catch exception class

Jordan Halgunseth 1 Reputation point

How does try catch exception class work?

Can you give an example?

Microsoft Technologies based on the .NET software framework.
3,323 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jack J Jun 24,276 Reputation points Microsoft Vendor

    @Jordan Halgunseth, Welcome to Microsoft Q&A,

    The try-catch statement consists of a try block followed by one or more catch clauses, which specify handlers for different exceptions. When an exception is thrown, the common language runtime (CLR) looks for the catch statement that handles this exception.

    The above sentence comes from Microsoft Learning try-catch (C# Reference), which may help you to learn more about how the try catch works.

    You also could look at the example.

    Hope my description could help you.

    Best Regards,


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments