本文整理匯總了VB.NET中System.Reflection.Module.GetType方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET Module.GetType方法的具體用法?VB.NET Module.GetType怎麽用?VB.NET Module.GetType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Reflection.Module
的用法示例。
在下文中一共展示了Module.GetType方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Main
' 導入命名空間
Imports System.Reflection
'This code assumes that the root namespace is set to empty("").
Namespace ReflectionModule_Examples
Class MyMainClass
Shared Sub Main()
Dim moduleArray() As [Module]
moduleArray = GetType(MyMainClass).Assembly.GetModules(False)
'In a simple project with only one module, the module at index
' 0 will be the module containing these classes.
Dim myModule As [Module] = moduleArray(0)
Dim myType As Type
myType = myModule.GetType("ReflectionModule_Examples.MyMainClass")
Console.WriteLine("Got type: {0}", myType.ToString())
End Sub
End Class
End Namespace 'ReflectionModule_Examples
示例2: Main
' 導入命名空間
Imports System.Reflection
'This code assumes that the root namespace is set to empty("").
Namespace ReflectionModule_Examples
Class MyMainClass
Shared Sub Main()
Dim moduleArray() As [Module]
moduleArray = GetType(MyMainClass).Assembly.GetModules(False)
'In a simple project with only one module, the module at index
' 0 will be the module containing these classes.
Dim myModule As [Module] = moduleArray(0)
Dim myType As Type
myType = myModule.GetType("ReflectionModule_Examples.MyMainClass", False)
Console.WriteLine("Got type: {0}", myType.ToString())
End Sub
End Class
End Namespace 'ReflectionModule_Examples
示例3: Main
' 導入命名空間
Imports System.Reflection
'This code assumes that the root namespace is set to empty("").
Namespace ReflectionModule_Examples
Class MyMainClass
Shared Sub Main()
Dim moduleArray() As [Module]
moduleArray = GetType(MyMainClass).Assembly.GetModules(False)
'In a simple project with only one module, the module at index
' 0 will be the module containing this class.
Dim myModule As [Module] = moduleArray(0)
Dim myType As Type
myType = myModule.GetType("ReflectionModule_Examples.MyMainClass", False, False)
Console.WriteLine("Got type: {0}", myType.ToString())
End Sub
End Class
End Namespace 'ReflectionModule_Examples