Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

get type of exception c#

try
{
    // do something here
}
catch(Exception ex)
{
	// will print System.NullReferenceException for example
    Console.WriteLine(ex.GetType().ToString());
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #type #exception
ADD COMMENT
Topic
Name
3+9 =