Results 1 to 3 of 3

Thread: [RESOLVED] Easy Question

  1. #1
    Lively Member
    Join Date
    Oct 06
    Location
    USA
    Posts
    119

    Resolved [RESOLVED] Easy Question

    I know this is a noob question however in a c# application what does the following do

    {...}

    at the end of catch statement.

    notrosh

  2. #2
    Fanatic Member Jumpercables's Avatar
    Join Date
    Jul 05
    Location
    Colorado
    Posts
    592

    Re: Easy Question

    The following coded will catch all exceptions and then do nothing, you should always do something when catching an exception, but there are always special cases.

    Code:
    try
    {
      // Try something
    }catch
    {
      // Catch all exceptions and do nothing...
    }

    C# - .NET 1.1 / .NET 2.0

    "Take everything I say with a grain of salt, sometimes I'm right, sometimes I'm wrong but in the end we've both learned something."
    _____________________
    Regular Expressions Library
    Connection String
    API Functions
    Database FAQ & Tutorial

  3. #3
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 05
    Posts
    930

    Re: Easy Question

    you can also do a

    try
    {
    }
    catch (Exception ex)
    {
    MessageBox.Show("your error message goes here" + Environment.NewLine + ex.Message);
    Console.WriteLine(ex.ToString());
    }


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •