VB.Net Tutorial/Reflection/GetType — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 15:54, 26 мая 2010
GetType Method
<source lang="vbnet">Option Strict On Public Module GetTypeMethod
Public Sub Main Dim firstName As String = "John" Dim firstNameType As Type = firstName.GetType() Console.WriteLine("The type of the variable firstname is {0}.", _ firstNameType) End Sub
End Module</source>
The type of the variable firstname is System.String.
Get variable type
<source lang="vbnet">Imports System Module MyModule
Sub Main() Dim i As Integer = 100 Dim j As Int32 = i Console.WriteLine("Integer: {0}", GetType(Integer).FullName) Console.WriteLine("Int32: {0}", GetType(Int32).FullName) End Sub
End Module</source>
Integer: System.Int32 Int32: System.Int32