PDA

Click to See Complete Forum and Search --> : INI Files


lavureddygudellyjn
Aug 2nd, 1999, 09:16 AM
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

ScottF
Aug 2nd, 1999, 01:46 PM
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.

atomsheep
Aug 2nd, 1999, 02:17 PM
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.

Ken Whiteman
Aug 2nd, 1999, 06:19 PM
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).]

Buzby
Aug 2nd, 1999, 08:21 PM
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 buzbyb@hotmail.com and I'll send some sample modules.

Troy Mac
Aug 2nd, 1999, 09:18 PM
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

ComputerGuy
Aug 2nd, 1999, 09:55 PM
On my side,

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

mocoo
Nov 30th, 1999, 04:05 PM
Do you encrypt values by hand or is there another API function to do it for INI files?

Serge
Nov 30th, 1999, 07:21 PM
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:

[Section]
|__Key
|__Subkey

It's very easy to do it in a registry and impossible to do in INI.

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

Serge

Software Developer
Serge_Dymkov@vertexinc.com
Access8484@aol.com
ICQ#: 51055819 (http://www.icq.com/51055819)



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

gpiper
Dec 1st, 1999, 06:51 AM
There is a good tip on using ini files on the vb-helper site. www.vb-helper.com (http://www.vb-helper.com)
Look in the How To section.
Glenn