Type.GetTypeArray メソッドとは? わかりやすく解説

Type.GetTypeArray メソッド

指定した配列内のオブジェクトの型を取得します。

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Shared Function GetTypeArray
 ( _
    args As Object() _
) As Type()
Dim args As Object()
Dim returnValue As Type()

returnValue = Type.GetTypeArray(args)
public static Type[] GetTypeArray (
    Object[] args
)
public:
static array<Type^>^ GetTypeArray (
    array<Object^>^ args
)
public static Type[] GetTypeArray (
    Object[] args
)
public static function GetTypeArray
 (
    args : Object[]
) : Type[]

パラメータ

args

型を確認する対象のオブジェクトの配列。

戻り値
args 内の対応する要素の型を表す Type オブジェクトの配列。

例外例外
例外の種類条件

ArgumentNullException

args が null 参照 (Visual Basic では Nothing) です。

TargetInvocationException

クラス初期化子が呼び出され、そのうちの少なくとも 1 つが例外をスローしました。

解説解説
使用例使用例
Dim myObject(2) As Object
myObject(0) = 66
myObject(1) = "puri"
myObject(2) = 33.33
' Get the array of 'Type' class objects.
Dim myTypeArray As Type() = Type.GetTypeArray(myObject)
Console.WriteLine("Full names of the 'Type'
 objects in the array are:")
Dim h As Integer
For h = 0 To myTypeArray.Length - 1
   Console.WriteLine(myTypeArray(h).FullName)
Next h
Object[] myObject = new Object[3];
myObject[0] = 66;
myObject[1] = "puri";
myObject[2] = 33.33;
// Get the array of 'Type' class objects.
Type[] myTypeArray = Type.GetTypeArray(myObject);
Console.WriteLine("Full names of the 'Type' objects in the
 array are:");
for(int h = 0; h < myTypeArray.Length ;
 h++)
{
    Console.WriteLine(myTypeArray[h].FullName);
}
array<Object^>^myObject = gcnew array<Object^>(3);
myObject[ 0 ] = 66;
myObject[ 1 ] = "puri";
myObject[ 2 ] = 33.33;

// Get the array of 'Type' class objects.
array<Type^>^myTypeArray = Type::GetTypeArray( myObject );
Console::WriteLine( "Full names of the 'Type' objects in
 the array are:" );
for ( int h = 0; h < myTypeArray->Length;
 h++ )
{
   Console::WriteLine( myTypeArray[ h ]->FullName );

}
Object myObject[] = new Object[3];
myObject.set_Item(0, (System.Int32)66);
myObject.set_Item(1, "puri");
myObject.set_Item(2, (System.Double)33.33);
// Get the array of 'Type' class objects.
Type myTypeArray[] = Type.GetTypeArray(myObject);
Console.WriteLine("Full names of the 'Type' objects in the
 array are:");
for (int h = 0; h < myTypeArray.get_Length();
 h++) {
    Console.WriteLine(myTypeArray[h].get_FullName());
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

Type.GetTypeArray メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Type.GetTypeArray メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS