Exportar (0) Imprimir
Expandir todo

RoleEnvironment.GetConfigurationSettingValue (Método)

Retrieves the value of a setting in the service configuration file.

Espacio de nombres: Microsoft.WindowsAzure.ServiceRuntime
Ensamblado: Microsoft.WindowsAzure.ServiceRuntime (en microsoft.windowsazure.serviceruntime.dll)

'Uso
Dim configurationSettingName As String
Dim returnValue As String

returnValue = RoleEnvironment.GetConfigurationSettingValue(configurationSettingName)

'Declaración
Public Shared Function GetConfigurationSettingValue ( _
	configurationSettingName As String _
) As String
public static String GetConfigurationSettingValue (
	String configurationSettingName
)
public static function GetConfigurationSettingValue (
	configurationSettingName : String
) : String

Parámetros

configurationSettingName

The name of the configuration setting.

Valor devuelto

A String that contains the value of the configuration setting.

Tipo de excepciónCondición
RoleEnvironmentException

The configuration setting that was being retrieved does not exist.

Configuration settings for a role are defined in the ServiceDefinition.csdef file and the values for the settings are configured in the ServiceConfiguration.cscfg file. For more information about defining and configuring settings, see Windows Azure Service Configuration Schema and Windows Azure Service Definition Schema.

The GetConfigurationSettingValue method can be used to retrieve the value that is defined in the ServiceDefinintion.cscfg file. The following code example shows how to get and write out the value for a setting called MySetting:


var settingValue = RoleEnvironment.GetConfigurationSettingValue("MySetting"); 
Trace.WriteLine("The setting value is: " + settingValue, "Information");

Cualquier miembro estático público (Shared en Visual Basic) de este tipo es seguro para subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.

Plataformas de desarrollo

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, Windows Server 2008 y Windows 2000

Plataformas de destino

Adiciones de comunidad

Mostrar:
© 2014 Microsoft