Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c# simple non-xml config files?

Is there a build-in way in C# to work with simple config files which ate not XML? Or maybe there are popular free libraries?

I'm making a simple tool for non-programmers to use, and I don't want to complicate it by adding UI for configuration editing. I just want users (all comfortable enough with computers) to just be able to open config file in notepad and edit/add a few lines. That's why I don't want to use XML based config file.


EDIT: Thanks everyone for replies! Yes, it's not hard to bind simple ui for editing xml-based config. but it's not always suitable. for example for non-gui app, or for very simple app you don't want to add any more ui to keep it maximally simple. and it's not even hard to write own config parser, for key/pair settings or blocks or settings separated by a blank line. But I just wanted to know what's out there available, as quick search on google just gives me lots of pages on working with xml based config.

i'm not full time sw developer, and usually write small tools that make my and my colleagues' my life a little ezer at work, so using known and tested solutions, naturally, simplifies that task.

like image 812
flamey Avatar asked Feb 28 '23 03:02

flamey


1 Answers

I usually use INI files for simple configuration. There's a nice article on The Code Project that provides a wrapper for the native Windows INI functions in Kernel32.

like image 107
David Brown Avatar answered Mar 11 '23 07:03

David Brown