Get the return type of this method in CSharp

Description

The following code shows how to get the return type of this method.

Example


//from  w  w  w. j a  va 2 s  .  com
using System;
using System.Reflection;

class Mymethodinfo
{
    public static int Main()
    {
        Type MyType = Type.GetType("System.Reflection.FieldInfo");
        MethodInfo Mymethodinfo = MyType.GetMethod("GetValue");
        Console.Write ("\n" + MyType.FullName + "." + Mymethodinfo.Name);
        Console.Write ("\nReturnType = {0}", Mymethodinfo.ReturnType);
        return 0;
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Reflection »




Array
Constructor
Event
Field
Interface
Method
Properties
Type