Results 1 to 10 of 10

Thread: INI Files

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Location
    secunderabad,A.P,INDIA
    Posts
    4

    Post

    what are INI files where can i use in
    project development i.e. I have developed a
    project and i want to write an INI File
    how this is helpfuel to the Project Development

  2. #2
    Addicted Member
    Join Date
    Apr 1999
    Location
    Freeport
    Posts
    204

    Post

    INI files were used by early version of Windows. Windows now uses Registry for hold path fonts etc. I use INI files in my project to hold password that are encrypt and path to databases and I also use windows 98 registry for the same reason. With the INI files I can include them with your program. I hope that help there is a lot more to learn about INI files but this is the way you start learn by asking.

  3. #3
    Junior Member
    Join Date
    Apr 1999
    Location
    Sydney, NSW, Australia
    Posts
    22

    Post

    personally i would prefer using ini files over the registry. the registry has a nasty habit of screwing up now and then. microsoft developed the registry so that instead of only losing one setting when the registry crashed, you would lose ALL of your settings. however, due to the popularity (or moreso the common usage) of the registry, it would be advisable to store your program's information in the registry. this means that there aren't any 'loose parts' with your program, like INI files. all your settings are in one central place with the registry.

  4. #4
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    Fort Worth, Texas, USA
    Posts
    264

    Post

    For the most part I agree with AtomSheep. I DO NOT use the registry because of the simple fact that it can and does crash. I use Ini files exclusively. I create them so the user can make changes that make sense to him, and I place them in a sub-directory called Config. The balance of the data I need to store goes into a different sub-directory.

    Use the registry because it's popular? I don't think so!

    Ken

    [This message has been edited by Ken Whiteman (edited 08-03-1999).]

    [This message has been edited by Ken Whiteman (edited 08-03-1999).]

  5. #5
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    An INI file is a plain text file you can use to store any* information you like. The file format is;

    [Header]
    Key=Data
    Key=Data
    etc

    VB World has some sample projects (search in the tips databases) re INI files, but basically you need to play around with GetPrivateProfileString and WritePrivateProfileString to read and write to them.

    *Limitations - you can't store multi-line strings in an .INI file, or pictures etc. But otherwise (eg Strings, numbers etc) you can without any problems.

    For more info send me an e-mail at [email protected] and I'll send some sample modules.

  6. #6
    Hyperactive Member
    Join Date
    Jan 1999
    Location
    North East America
    Posts
    463

    Post

    ini files are the way to go avoid using the registry when ever you can. It does crash and I find the larger it gets the longer it takes you computer to boot. It's easy to put your ini file in your apps path then you know where it is! Although before I began to use them I found it hard to find good tutorials on the subject. Most of the tutorials I found through large uncommented modules at you and they were hard to decipher. Good Luck

    ------------------
    Troy MacPherson


  7. #7
    Junior Member
    Join Date
    May 1999
    Location
    Nepean,Ontario,Canada
    Posts
    16

    Post

    On my side,

    I use INI file to keep track of the user setting : COM port, LPT port, language, password (encrypted), an so on....


  8. #8
    New Member
    Join Date
    Nov 1999
    Posts
    8

    Post

    Do you encrypt values by hand or is there another API function to do it for INI files?

  9. #9
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Post

    The only thing that I like registry better then INI file is because you can create a child Keys, SubKeys etc, where in INI file you always stock with one key per section:

    Example: I want to have the structure like this:
    Code:
    [Section]
    |__Key
       |__Subkey
    It's very easy to do it in a registry and impossible to do in INI.

    ------------------

    Serge

    Software Developer
    [email protected]
    [email protected]
    ICQ#: 51055819



    [This message has been edited by Serge (edited 12-01-1999).]

  10. #10
    New Member
    Join Date
    Nov 1999
    Posts
    8

    Post

    There is a good tip on using ini files on the vb-helper site. www.vb-helper.com
    Look in the How To section.
    Glenn

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