Home All Groups Group Topic Archive Search About

Deleting INI file entry

Author
13 Apr 2006 2:01 AM
Adam Honek
I'm using GetPrivateProfileString and WritePrivateProfileString for IO to an
INI file.

How does one delete an trying within an INI file?

Thanks,
Adam

Author
13 Apr 2006 2:18 AM
Homer J Simpson
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
news:%230SPMXpXGHA.508@TK2MSFTNGP02.phx.gbl...

> I'm using GetPrivateProfileString and WritePrivateProfileString for IO to
> an INI file.
>
> How does one delete any thing within an INI file?

Not sure you can. Just set it to "" or ignore it.

You can overwrite the settings.
Author
13 Apr 2006 2:27 AM
vbnetdev
http://www.codeguru.com/forum/archive/index.php/t-189920.html


--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com



Show quote Hide quote
"Adam Honek" <AdamHo***@Webmaster2001.freeserve.co.uk> wrote in message
news:%230SPMXpXGHA.508@TK2MSFTNGP02.phx.gbl...
> I'm using GetPrivateProfileString and WritePrivateProfileString for IO to
> an INI file.
>
> How does one delete an trying within an INI file?
>
> Thanks,
> Adam
>
Author
13 Apr 2006 5:16 AM
Tom Shelton
Adam...

If you want to delete a single key from an ini file you use
WritePrivateProfileString like this:

WritePrivateProfileString ("section name", "key name", Nothing, "file
name")

If you want to delete a whole section:

WritePrivateProfileString ("section name", Nothing, Nothing, "file
name")

HTH,
Tom Shelton [MVP]
Author
13 Apr 2006 10:33 PM
Jonny
Here's an INI module that I have always used. The creator explains what the
code does too:

http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=F5739733-A34D-4AFD-8363-5F958B73BDDD

Happy to help
Author
16 Apr 2006 6:30 AM
Adam Honek
Thanks all, I'll try it all out tonight and see how it unfolds in a code
sense.

Adam

Show quoteHide quote
"Jonny" <jo***@beagood.sod> wrote in message
news:eG2Ovo0XGHA.508@TK2MSFTNGP02.phx.gbl...
> Here's an INI module that I have always used. The creator explains what
> the
> code does too:
>
> http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=F5739733-A34D-4AFD-8363-5F958B73BDDD
>
> Happy to help
>
>