ApplicationIdentity.CodeBase 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取部署清单作为 URL 的位置。
public:
property System::String ^ CodeBase { System::String ^ get(); };
public string CodeBase { get; }
member this.CodeBase : string
Public ReadOnly Property CodeBase As String
属性值
部署清单的 URL。
示例
下面的代码示例演示如何使用对象 ApplicationIdentity 获取基于清单的应用程序的属性 CodeBase 的值。 该代码示例是 ActivationContext 类中的一个较大示例的一部分。
ActivationContext ac = AppDomain.CurrentDomain.ActivationContext;
ApplicationIdentity ai = ac.Identity;
Console.WriteLine("Full name = " + ai.FullName);
Console.WriteLine("Code base = " + ai.CodeBase);
Dim ac As ActivationContext = AppDomain.CurrentDomain.ActivationContext
Dim ai As ApplicationIdentity = ac.Identity
Console.WriteLine("Full name = " + ai.FullName)
Console.WriteLine("Code base = " + ai.CodeBase)
注解
下面是名为 ActivationContext 的应用程序的属性值的 CodeBase 两个示例:
http://testserver/ActivationContext/ActivationContext.applicationfile://C:/UserFiles/UserName/SolutionName/ActivationContext/publish/ActivationContext.application。