本文整理匯總了VB.NET中System.AppDomain.ReflectionOnlyGetAssemblies方法的典型用法代碼示例。如果您正苦於以下問題:VB.NET AppDomain.ReflectionOnlyGetAssemblies方法的具體用法?VB.NET AppDomain.ReflectionOnlyGetAssemblies怎麽用?VB.NET AppDomain.ReflectionOnlyGetAssemblies使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.AppDomain
的用法示例。
在下文中一共展示了AppDomain.ReflectionOnlyGetAssemblies方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
' 導入命名空間
Imports System.Reflection
Imports System.Timers
Public Class Example
Public Shared Sub Main()
' Get the assembly display name for System.dll, the assembly
' that contains System.Timers.Timer. Note that this causes
' System.dll to be loaded into the execution context.
'
Dim displayName As String = GetType(Timer).Assembly.FullName
' Load System.dll into the reflection-only context. Note that
' if you obtain the display name (for example, by running this
' example program), and enter it as a literal string in the
' preceding line of code, you can load System.dll into the
' reflection-only context without loading it into the execution
' context.
Assembly.ReflectionOnlyLoad(displayName)
' Display the assemblies loaded into the execution and
' reflection-only contexts. System.dll appears in both contexts.
'
Dim ad As AppDomain = AppDomain.CurrentDomain
Console.WriteLine("------------- Execution Context --------------")
For Each a As Assembly In ad.GetAssemblies()
Console.WriteLine(vbTab + "{0}", a.GetName())
Next a
Console.WriteLine("------------- Reflection-only Context --------------")
For Each a As Assembly In ad.ReflectionOnlyGetAssemblies()
Console.WriteLine(vbTab + "{0}", a.GetName())
Next a
End Sub
End Class