Questo argomento non è stato ancora valutato - Valuta questo argomento

Metodo RoleEnvironment.GetConfigurationSettingValue

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

Spazio dei nomi: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in microsoft.windowsazure.serviceruntime.dll)
'Utilizzo
Dim configurationSettingName As String
Dim returnValue As String

returnValue = RoleEnvironment.GetConfigurationSettingValue(configurationSettingName)
public:
static String^ GetConfigurationSettingValue (
	String^ configurationSettingName
)
public static String GetConfigurationSettingValue (
	String configurationSettingName
)
public static function GetConfigurationSettingValue (
	configurationSettingName : String
) : String

Parametri

configurationSettingName

The name of the configuration setting.

Valore restituito

A String that contains the value of the configuration setting.
Tipo di eccezioneCondizione
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");

Tutti i membri statici pubblici (Shared in Visual Basic) di questo tipo sono thread-safe. I membri di istanza non sono garantiti come thread-safe.

Piattaforme di sviluppo

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

Piattaforme di destinazione

Il documento è risultato utile?
(1500 caratteri rimanenti)

Aggiunte alla community

© 2013 Microsoft. Tutti i diritti riservati.
facebook page visit twitter rss feed newsletter