Rash thoughts about .NET, C#, F# and Dynamics NAV.


"Every solution will only lead to new problems."

Thursday, 17. August 2006


Konfigurationsdateien schnell und flexibel

Filed under: C# — Sebastian Wolf at 17:03 Uhr

Nini ist eine .Net Library mit welcher man besonders schnell hoch flexible Anwendungen mit Konfigurationsdateien erstellen kann. Die Anwendung ist denkbar einfach wie man im folgenden Beispiel sieht:

; MyApp.ini [Logging] File Name = MyApp.log MessageColumns = 5 MaxFileSize = 40000000000000

Und der C# Code zum einlesen sieht folgendermasen aus:

using Nini.Config; IConfigSource source = new IniConfigSource("MyApp.ini"); string fileName = source.Configs["Logging"].Get("File Name"); int columns = source.Configs["Logging"].GetInt("MessageColumns"); long fileSize = source.Configs["Logging"].GetLong("MaxFileSize");

Das war aber noch längst nicht alles. Noch mehr gibt es hier.

No Comments »

No comments yet.

RSS feed for comments on this post. | TrackBack URI

Leave a comment

XHTML ( You can use these tags): <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> .