Horje
c# try catch multiple catches Code Example
c# try catch multiple catches
            try
            {
                Console.WriteLine("Chose a number: ");
                int usrNo = Convert.ToInt32(Console.ReadLine());
                return usrNo;
            }
            catch (FormatException ex) 
            { 
              ErrorMessagePrintCustomMessage("You pressed a letter"); 
            }
            catch (Exception ex) { ErrorMessageErrorOccured(ex); }
c# catch two exceptions in one block
catch (Exception ex)            
{                
    if (ex is FormatException || ex is OverflowException)
    {
        WebId = Guid.Empty;
        return;
    }

    throw;
}




Csharp

Related
dynamic arrays in c# Code Example dynamic arrays in c# Code Example
GetMousebuttonDown unity Code Example GetMousebuttonDown unity Code Example
c# encode jpg hiight quality Code Example c# encode jpg hiight quality Code Example
c# skip following code in loop Code Example c# skip following code in loop Code Example
how to show the value of a string in c# Code Example how to show the value of a string in c# Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8