Re: Using the registry



"J French" <erewhon@xxxxxxxxxx> wrote in message
news:4295b90d.13132139@xxxxxxxxxxxxxxxxxxx

<using a .ini file>

> Smart move


<using the Registry>

> Not so smart move

That is your *opinion*.


> - it makes your App hard to backup and restore
> - /when/ the Registry goes down - your App is hosed
> - RegMon is a very easy to use tool

I've never had the Registry implode on me. FileMon is just as
easy to use as RegMon, and in fact your first argument is the
only one I would consider valid. But not very pressing. And
keeping the settings with the binaries requires write access
to the directory, which is a bad idea _and_ on its way out.

The Registry has the advantage that HKLM is pre-mounted if you
want to store settings on a per-user basis. The programmer can
use the same path every time and things just work.

The Registry also has the advantage of being hierarchical. I find
this suits me well. One of my favourite tricks is to store the
screen layout in a key hierarchy that mirrors the Parent structure
of the controls starting at the form. .Ini files are flat.


> Personally I would 'lock' the INI file with a CRC32
>
> It drives people nuts being able to see the options in the INI file,
> but also see a ruddy great warning saying :
>
> EnterprizeUser=False
> ; WARNING machine generated file - DO NOT EDIT
> LockCRC: 97649897546
>
> A really adept cracker will simply frig your code, but this simple INI
> file 'lock' will provide the less adept with hours of good clean
> frustration.

This technique is not limited to files.

Groetjes,
Maarten Wiltink


.



Relevant Pages

  • Re: Best way to use INI file
    ... I was told that there may be some issues with the security settings on ... I didn't have a way to test writing to the registry and I ... Is there any particular reason you are using an INI file rather ... than GetSettings and SaveSetting to store data in the registry. ...
    (microsoft.public.excel.programming)
  • Re: Best way to use INI file
    ... I was told that there may be some issues with the security settings on ... I didn't have a way to test writing to the registry and I ... Is there any particular reason you are using an INI file ... rather than GetSettings and SaveSetting to store data in the registry. ...
    (microsoft.public.excel.programming)
  • Re: registry entry or file
    ... Is there any specific format to follow in INI file. ... > registry, unless necessary. ... > prompted me to spout my opinion because they disagree with me). ... >>This dll will be distributed in productsand used by PC ...
    (microsoft.public.win32.programmer.ui)
  • Re: INI file perhaps?
    ... You can certainly save settings in an INI file. ... a table in the database itself. ... commands/builtin functions for writing to and retrieving from the Registry. ... Microsoft Access MVP ...
    (comp.databases.ms-access)
  • Re: Registry vs .ini Win 2000
    ... > has no registry but it does support INI and configuration files ... you should have an ini file. ... > registry settings isn't the best option. ... > tool, it needs to read the installation path from the registry, an ...
    (microsoft.public.win2000.registry)