MethodInfo::ReturnType Property
.NET Framework (current version)
Gets the return type of this method.
Assembly: mscorlib (in mscorlib.dll)
Implements
_MethodInfo::ReturnTypeTo get the return type property, first get the class Type. From the Type, get the MethodInfo. From the MethodInfo, get the ReturnType.
The following example displays the return type of the specified method.
using namespace System; using namespace System::Reflection; 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{0}.{1}", MyType->FullName, Mymethodinfo->Name ); // Get and display the ReturnType. Console::Write( "\nReturnType = {0}", Mymethodinfo->ReturnType ); return 0; }
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: