Dim url, ruta1_general As String
Dim rootWebConfig1 As System.Configuration.Configuration
rootWebConfig1 = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Nothing)
If (0 < rootWebConfig1.AppSettings.Settings.Count) Then
Dim customSetting As System.Configuration.KeyValueConfigurationElement
customSetting = rootWebConfig1.AppSettings.Settings("pablo")
If Not (Nothing = customSetting.Value) Then
url = customSetting.Value()
End If
customSetting = rootWebConfig1.AppSettings.Settings("rutageneral")
If Not (Nothing = customSetting.Value) Then
ruta1_general = customSetting.Value()
End If
End If
Here is the web.config:
<?xml version="1.0"?> <configuration> <appSettings> <add key="pablo" value="value1" /> <add key="rutageneral" value="value2" /> </appSettings> <connectionStrings/> <system.web> . . .
THe problem is the next, when I start the program, the application doesn't enter in the first IF of my code:
If (0 < rootWebConfig1.AppSettings.Settings.Count) Then
I don't Know what is happening, is somebody has an idea would be great! Thank you!
Pablo

New Topic/Question
Reply




MultiQuote




|