C# Type UnderlyingSystemType
Description
Type UnderlyingSystemType
indicates the type provided
by the common language runtime that represents this type.
Syntax
Type.UnderlyingSystemType
has the following syntax.
public abstract Type UnderlyingSystemType { get; }
Example
using System;/*w ww.j av a 2 s . co m*/
using System.Reflection;
class MyClass
{
public int myField = 10;
}
class Type_TypeHandle
{
public static void Main()
{
try
{
MyClass myClass = new MyClass();
Type myClassType = myClass.GetType();
Console.WriteLine(myClassType.UnderlyingSystemType);
}
catch(Exception e)
{
Console.WriteLine("Exception: {0}", e.Message );
}
}
}
The code above generates the following result.