linuxmonoinidelphi-prism

how to create inifile in Delphi Prism for .net that will work on window and Linux(Mono)?


My Delphi Prism program needs to create and read and write into an inifile, but I think I noticed Delphi Prism doesn't really support any sort of Inifile structure. (Correct me if I am wrong.)

This leads me into talking about ShineOn library file, which supports inifile. However, it crashes the program when you run your program on Linux under Mono. It doesn't matter if I use any methods from ShineOn or not. As long as the ShineOn library file is listed under uses keyword, the program does not run but crash completely on Linux. Can you create inifile in Delphi Prism for .net that will work on window and Linux(Mono)? If so, how would you do it?

I did search for answer on the internet and Stackoverflow, which led to me C# Class INI file. I thought, it was promising until I noticed that it needs to load Kernel32.dll file to work. (Again correct me if I am wrong). Apparently, there is very little information on the Internet about Delphi Prism Inifile.


Solution

  • Actually you really shouldn't use .ini - Files in .NET (or Mono) environments at all. .NET and Mono offer complete App.config XML-Configuration infrastructure and you should leverage this for your applications. There are a lot of advantages because everything is available type safe and all is covered in the System.Configuration Namespace.