Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ApplicationId Class

Note: This class is new in the .NET Framework version 2.0.

Contains information used to uniquely identify an application. This class cannot be inherited.

Namespace: System
Assembly: mscorlib (in mscorlib.dll)

'Declaration
<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public NotInheritable Class ApplicationId
'Usage
Dim instance As ApplicationId

/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public final class ApplicationId
SerializableAttribute 
ComVisibleAttribute(true) 
public final class ApplicationId

An application identity consists of the publisher's public key, the application name, the target processor architecture, the application culture, and the application version. The application identity properties values correspond to information contained in the application manifest.

ApplicationId is used by the ApplicationSecurityInfo class to identify an application.

The following code example displays the ApplicationId properties by obtaining the ApplicationId from an ApplicationSecurityInfo instance created using the ActivationContext for the currently executing manifest-based application.

Imports System
Imports System.Collections
Imports System.Text
Imports System.Security.Policy
Imports System.Reflection
Imports System.Security
Imports System.Security.Permissions



Public Class Program
    Inherits MarshalByRefObject
    <SecurityPermission(SecurityAction.Demand, ControlDomainPolicy:=true)> _
    Public Shared Sub Main(ByVal args() As String) 
        Console.WriteLine("Full name = " + _
            AppDomain.CurrentDomain.ActivationContext.Identity.FullName)
        Console.WriteLine("Code base = " + _
            AppDomain.CurrentDomain.ActivationContext.Identity.CodeBase)
        Dim asi As New ApplicationSecurityInfo(AppDomain.CurrentDomain.ActivationContext)     
        Console.WriteLine("ApplicationId.Name property = " + asi.ApplicationId.Name)
        If Not (asi.ApplicationId.Culture Is Nothing) Then
            Console.WriteLine("ApplicationId.Culture property = " + _
            asi.ApplicationId.Culture.ToString())
        Console.WriteLine("ApplicationId.ProcessorArchitecture property = " + _
            asi.ApplicationId.ProcessorArchitecture)
        Console.WriteLine("ApplicationId.Version property = " + _
            asi.ApplicationId.Version.ToString())
        ' To display the value of the public key, enumerate the Byte array for the property.
        Console.Write("ApplicationId.PublicKeyToken property = ")
        Dim pk As Byte() = asi.ApplicationId.PublicKeyToken
        Dim i As Integer
        For i = 0 To (pk.GetLength(0))
            Console.Write("{0:x}", pk(i))
        Next i 
        Console.Read()
    
    End Sub 'Main
    
    Public Sub Run() 
        Main(New String() {})  
    End Sub 'Run
End Class 'Program

System.Object
  System.ApplicationId

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

Show:
© 2017 Microsoft