Dışarıya aktar (0) Yazdır
Tümünü Genişlet
EN
Bu içerik dilinizde bulunmamaktadır ancak İngilizce sürümüne buradan bakabilirsiniz.

RoleInstance.Id Property

Updated: December 6, 2013

Gets the instance identifier (ID) of the role instance.

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)

public abstract string Id { get; }

Property Value

Type: System.String

A String that contains the instance ID for the role instance.

The following code example shows how to retrieve the instance ID for role instances:


foreach (var role in RoleEnvironment.Roles) 
{
   foreach (var roleInstance in role.Value.Instances)      
   {
      Trace.WriteLine("Role instance ID: " + roleInstance.Id, "Information");
   }
}

The instance ID is unique to the application. If a role instance is stopped and has been configured to restart automatically, the restarted role instance will have the same instance ID as the stopped role instance.


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

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms

Topluluk İçeriği

Ekle
Show:
© 2014 Microsoft