本文整理匯總了VB.NET中System.Type.GetElementType方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Type.GetElementType方法的具體用法?VB.NET Type.GetElementType怎麽用?VB.NET Type.GetElementType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Type
的用法示例。
在下文中一共展示了Type.GetElementType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: TestGetElementType
Class TestGetElementType
Public Shared Sub Main()
Dim array As Integer() = {1, 2, 3}
Dim t As Type = array.GetType()
Dim t2 As Type = t.GetElementType()
Console.WriteLine("The element type of {0} is {1}.", array, t2.ToString())
Dim newMe As New TestGetElementType()
t = newMe.GetType()
t2 = t.GetElementType()
If t2 Is Nothing Then
Console.WriteLine("The element type of {0} is {1}.", newMe, "null")
Else
Console.WriteLine("The element type of {0} is {1}.", newMe, t2.ToString())
End If
End Sub
End Class
輸出:
The element type of System.Int32[] is System.Int32. The element type of TestGetElementType is null.