Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created July 23, 2012 05:45
Show Gist options
  • Save sandrinodimattia/3162131 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/3162131 to your computer and use it in GitHub Desktop.
IServerConfigurationProvider sample
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