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.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version