VB.Net Tutorial/Reflection/GetType — различия между версиями
| Admin (обсуждение | вклад) м (1 версия) | Admin (обсуждение | вклад)  м (1 версия) | 
| (нет различий) | |
Текущая версия на 12:54, 26 мая 2010
GetType Method
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 ModuleThe type of the variable firstname is System.String.
Get variable type
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 ModuleInteger: System.Int32 Int32: System.Int32
