Results 1 to 1 of 1

Thread: INIFile class

  1. #1

    Thread Starter
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    INIFile class

    This is something i wrote for myself recently and figure others might find useful too, as already since creating this i've found many quick uses for it (i find it easiest to compile it as a dll and reference it when needed).

    With this class, simply create an instance(providing a fully qualified filename) and start accessing variables right away with functions .setValue(<group name>,<key name>,<new value>) .getValue(<group name>,<key name>) or .Group(<group name>)

    Group will return an INIGroup class which also has .setValue and .getValue (without the group parameter).

    If you use .getValue and it doesn't exist, you will simply be returned an empty string. All file operations are handled by the class, when you set a value it will be changed in the ini file, when you instantiate the class it will read from the file. These operations can also be forced.

    NOTE: Terminology of group key and value, example INI below
    [GROUP]
    key=value

    NOTE: there is also a few more functions i havn't mentioned to play with like .Group(<group>).GetKey(<index>)

    code written in C# 2005
    Attached Files Attached Files
    Last edited by Phill64; May 15th, 2007 at 01:33 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width