Created
July 23, 2012 05:45
-
-
Save sandrinodimattia/3162131 to your computer and use it in GitHub Desktop.
IServerConfigurationProvider sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (IKernel krn = new StandardKernel()) | |
{ | |
// Create bindings. | |
krn.Load(new ConfigurationModule()); | |
// Get the provider and read the app.config. | |
var prov = krn.Get<IServerConfigurationProvider>(); | |
var config = prov.Read(); | |
// Display. | |
Console.WriteLine("Server: {0}", config.Server); | |
Console.WriteLine("Port: {0}", config.Port); | |
Console.Read(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment