MethodInfo.ReturnType 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
이 메서드의 반환 형식을 가져옵니다.
public:
virtual property Type ^ ReturnType { Type ^ get(); };
public:
abstract property Type ^ ReturnType { Type ^ get(); };
public virtual Type ReturnType { get; }
public abstract Type ReturnType { get; }
member this.ReturnType : Type
Public Overridable ReadOnly Property ReturnType As Type
Public MustOverride ReadOnly Property ReturnType As Type
속성 값
이 메서드의 반환 형식입니다.
구현
예제
다음 예제에서는 지정된 메서드의 반환 형식을 표시합니다.
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;
}
using System;
using System.Reflection;
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;
}
}
Imports System.Reflection
Class Mymethodinfo1
Public Shared Function Main() As Integer
Console.WriteLine(ControlChars.Cr + "Reflection.MethodInfo")
'Get the Type and MethodInfo.
Dim MyType As Type = Type.GetType("System.Reflection.FieldInfo")
Dim Mymethodinfo As MethodInfo = MyType.GetMethod("GetValue")
Console.Write(ControlChars.Cr _
+ MyType.FullName + "." + Mymethodinfo.Name)
'Get and display the ReturnType.
Console.Write(ControlChars.Cr _
+ "ReturnType = {0}", Mymethodinfo.ReturnType)
Return 0
End Function
End Class
설명
반환 형식 속성을 얻으려면 먼저 클래스 Type
를 가져옵니다. 에서 를 Type
가져옵니다 MethodInfo
. 에서 를 MethodInfo
가져옵니다 ReturnType
.
적용 대상
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET