Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / INI File Reading/Writing Module

Author
Message
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 28th Nov 2009 16:41
Well, lately I've been digging around the net for some INI modules/classes because I prefer them above *.cfg or XML files because of their simplicity... And have come across this very neat module which is being shared all across the net by numerous people. It works just fine and I use it myself as well, It's pretty darn simple as well and requires no external DLLs to accompany the .exe since it uses Windows Shell commands.



Sure, it's not meant for dynamic use of storing data in-game, since reading/writing INI files is a tad slow, but it can be used to store settings or anything else you would have to load ONCE and then never again while the program runs. I'm currently using it for the settings file for my Map Editor, and so far so good. The commands are pretty straightforward and you'll probably understand all of them and what they do if you just read the names, so I won't bother adding a whole explanation to this post on how to use them, just save the above snippet as a Module and you're ready to go!

NOTE : I myself did NOT write this code, I've found it somewhere on the internet... I'd give the exact URL but unfortunantly I've lost all my bookmarks in my recent hard drive failure. Still got my projects backed up though.


EDP Map Editor[2D]
Stefano
User Banned
Posted: 28th Nov 2009 18:34
According to Microsoft INI files where superseeded by registry.

Registry data can be set/get with my.computer.registry object

During program installation a registry data can be set for the application. Application could/should allow a user to change 'preferences' with a dedicated form and then set the registry data
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 28th Nov 2009 19:55
Stefano, some people(such as me) prefer the old fashion INI method... I know there's faster methods, but I still like INI files more because of their simplicity.


EDP Map Editor[2D]
Stefano
User Banned
Posted: 29th Nov 2009 01:06
Yes, INI files are very easy to use and my intention was not to critic their use, but only to add extra info
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 29th Nov 2009 09:34
Ah, I see. My apologies for misunderstanding the intentions of your post then.


EDP Map Editor[2D]

Login to post a reply

Server time is: 2024-04-24 02:36:24
Your offset time is: 2024-04-24 02:36:24