• Top Posts

    How to catch multiple exceptions at once in C#


    • By the use of following program we can return multiple catches like Format Exceptions and overflow exceptions...........



     static void Main(string[] args)  
         {  
           ;  
           try  
           {  
           }  
           catch (Exception ex)  
           {  
             if (ex is FormatException || ex is OverflowException)  
             {  
               WebId = Guid.Empty;  
               return;  
             }  
             throw;  
           }  
         }  
    

    No comments

    Post Top Ad

    ad728

    Post Bottom Ad

    ad728