When implemented by a subclass, this property retrieves the Type of this method's return value.
[Visual Basic] MustOverride Public ReadOnly Property ReturnType As Type [C#] public Type ReturnType {abstract get;} [C++] public: __property virtual Type* get_ReturnType() = 0; [JScript] public abstract function get ReturnType() : Type;
Read-only. The Type of object this method returns.
The return type of the method.
To get the return type property, first get the class Type. From the Type, get the MethodInfo. From the MethodInfo, get the ReturnType.
[C#]
class Mymethodinfo { public static int Main() { Console.WriteLine ("\nReflection.MethodInfo"); //Get the Type and MethodInfo Type MyType = Type.GetType("System.Reflection.FieldInfo"); MethodInfo Mymethodinfo = MyType.GetMethod("GetValue"); Console.Write ("\n" + MyType.FullName + "." + Mymethodinfo.Name); //Get and display the ReturnType Console.Write ("\nReturnType - {0}", Mymethodinfo.ReturnType); return 0; } } Produces the following output Reflection.MethodInfo System.Reflection.FieldInfo.GetValue ReturnType - System.Variant
MethodInfo Class | MethodInfo Members | System.Reflection Namespace