本文整理匯總了VB.NET中System.AppDomain.BaseDirectory屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET AppDomain.BaseDirectory屬性的具體用法?VB.NET AppDomain.BaseDirectory怎麽用?VB.NET AppDomain.BaseDirectory使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.AppDomain
的用法示例。
在下文中一共展示了AppDomain.BaseDirectory屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Example
' 導入命名空間
Imports System.IO
Imports System.Reflection
Imports System.Security.Policy
Module Example
Public Sub Main()
' Create the application domain setup information.
Dim domaininfo As New AppDomainSetup()
domaininfo.ConfigurationFile = Environment.CurrentDirectory +
Path.DirectorySeparatorChar +
"ADSetup.exe.config"
domaininfo.ApplicationBase = Environment.CurrentDirectory
'Create evidence for the new appdomain from evidence of the current application domain.
Dim adEvidence As Evidence = AppDomain.CurrentDomain.Evidence
' Create appdomain.
Dim domain As AppDomain = AppDomain.CreateDomain("Domain2", adevidence, domaininfo)
' Display the application domain information.
Console.WriteLine(("Host domain: " + AppDomain.CurrentDomain.FriendlyName))
Console.WriteLine(("Child domain: " + domain.FriendlyName))
Console.WriteLine()
Console.WriteLine(("Configuration file: " + domain.SetupInformation.ConfigurationFile))
Console.WriteLine(("Application Base Directory: " + domain.BaseDirectory))
AppDomain.Unload(domain)
End Sub
End Module
輸出:
Host domain: adsetup.exe Child domain: Domain2 Configuration file: C:\Test\ADSetup.exe.config Application Base Directory: C:\Test