D
Dave Hall
I'm having trouble figuring out how to use the
System.Configuration.ConfigurationSettings.AppSettings class. I have an xml
formatted file named MyApp.config. It's in the same directory as MyApp.exe.
The xml looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="LookFor" value="Found It" />
</appSettings>
</configuration>
MyApp.exe is a generic VB Windows application. In the FormLoad event, I add
the following line and set a breakpoint on it in Visual Studio:
Dim FindThis As String =
System.Configuration.ConfigurationSettings.AppSettings("LookFor")
After stepping past the line, the variable FindThis is still nothing. I
expect it to have a value of "Found It"
What am I missing?
Thanks,
Dave
System.Configuration.ConfigurationSettings.AppSettings class. I have an xml
formatted file named MyApp.config. It's in the same directory as MyApp.exe.
The xml looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="LookFor" value="Found It" />
</appSettings>
</configuration>
MyApp.exe is a generic VB Windows application. In the FormLoad event, I add
the following line and set a breakpoint on it in Visual Studio:
Dim FindThis As String =
System.Configuration.ConfigurationSettings.AppSettings("LookFor")
After stepping past the line, the variable FindThis is still nothing. I
expect it to have a value of "Found It"
What am I missing?
Thanks,
Dave