AppSettingsReader ar = new AppSettingsReader();
Console.WriteLine(ar.GetValue("appConStr", typeof(string))); // Now get the number of times to say hello, and then do it!
int numbOfTimes = (int)ar.GetValue("timesToSayHello", typeof(int));
for(int i = 0; i < numbOfTimes; i++)
Console.WriteLine("Howdy!");
Console.ReadLine();
}
*.config file. However, if you ever needed to programmatically add new elements to
C H A P T E R 1 5 ■
I N T R O D U C I N G . N E T A S S E M B L I E S
8849CH15.qxd 10/22/07 1:46 PM Page 521
the .NET Framework 3.5 SDK documentation for complete details.