Get the name of the current Type in CSharp

Description

The following code shows how to get the name of the current Type.

Example


using System;/*from ww w.  j  a v a 2s  . c om*/
using System.Reflection;

class Mymemberinfo
{
    public static int Main()
    {
        Type MyType = Type.GetType("System.String");
        Console.Write(MyType.Name);
        return 0;
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Reflection »




Array
Constructor
Event
Field
Interface
Method
Properties
Type