Assembly.GetTypes メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As Assembly Dim returnValue As Type() returnValue = instance.GetTypes
このアセンブリで定義されているすべての型のオブジェクトを格納している Type 型の配列。



Dim SampleAssembly As [Assembly] SampleAssembly = [Assembly].LoadFrom("c:\Sample.Assembly.dll") ' Obtain a reference to a method known to exist in assembly. Dim Method As MethodInfo = SampleAssembly.GetTypes()(0).GetMethod("Method1") ' Obtain a reference to the parameters collection of the MethodInfo instance. Dim Params As ParameterInfo() = Method.GetParameters() ' Display information about method parameters. ' Param = sParam1 ' Type = System.String ' Position = 0 ' Optional=False Dim Param As ParameterInfo For Each Param In Params Console.WriteLine(("Param=" + Param.Name.ToString())) Console.WriteLine((" Type=" + Param.ParameterType.ToString())) Console.WriteLine((" Position=" + Param.Position.ToString())) Console.WriteLine((" Optional=" + Param.IsOptional.ToString())) Next Param
Assembly SampleAssembly; SampleAssembly = Assembly.LoadFrom("c:\\Sample.Assembly.dll"); // Obtain a reference to a method known to exist in assembly. MethodInfo Method = SampleAssembly.GetTypes()[0].GetMethod("Method1"); // Obtain a reference to the parameters collection of the MethodInfo instance. ParameterInfo[] Params = Method.GetParameters(); // Display information about method parameters. // Param = sParam1 // Type = System.String // Position = 0 // Optional=False foreach (ParameterInfo Param in Params) { Console.WriteLine("Param=" + Param.Name.ToString()); Console.WriteLine(" Type=" + Param.ParameterType.ToString()); Console.WriteLine(" Position=" + Param.Position.ToString()); Console.WriteLine(" Optional=" + Param.IsOptional.ToString()); }
Assembly^ SampleAssembly; SampleAssembly = Assembly::LoadFrom( "c:\\Sample.Assembly.dll" ); // Obtain a reference to a method known to exist in assembly. MethodInfo^ Method = SampleAssembly->GetTypes()[ 0 ]->GetMethod( "Method1" ); // Obtain a reference to the parameters collection of the MethodInfo instance. array<ParameterInfo^>^ Params = Method->GetParameters(); // Display information about method parameters. // Param = sParam1 // Type = System::String // Position = 0 // Optional=False for each ( ParameterInfo^ Param in Params ) { Console::WriteLine( "Param= {0}", Param->Name ); Console::WriteLine( " Type= {0}", Param->ParameterType ); Console::WriteLine( " Position= {0}", Param->Position ); Console::WriteLine( " Optional= {0}", Param->IsOptional ); }
var SampleAssembly : Assembly; SampleAssembly = Assembly.LoadFrom("c:\\Sample.Assembly.dll"); // Obtain a reference to a method known to exist in assembly. var Method : MethodInfo = SampleAssembly.GetTypes()[0].GetMethod("Method1"); // Obtain a reference to the parameters collection of the MethodInfo instance. var Params : ParameterInfo[] = Method.GetParameters(); // Display information about method parameters. // Param = sParam1 // Type = System.String // Position = 0 // Optional=False for (var i : int in Params){ var Param : ParameterInfo = Params[i]; Console.WriteLine("Param=" + Param.Name.ToString()); Console.WriteLine(" Type=" + Param.ParameterType.ToString()); Console.WriteLine(" Position=" + Param.Position.ToString()); Console.WriteLine(" Optional=" + Param.IsOptional.ToString()); }


Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


_Assembly.GetTypes メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As _Assembly Dim returnValue As Type() returnValue = instance.GetTypes
このアセンブリで定義されているすべての型のオブジェクトを格納している Type 型の配列。


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からAssembly.GetTypesを検索する場合は、下記のリンクをクリックしてください。

- Assembly.GetTypesのページへのリンク