Results 1 to 4 of 4

Thread: delete [test] in ini-file

  1. #1

    Thread Starter
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330
    Hello

    My inifile:
    [XXXX]
    Key=hello

    Does anyone know how to effectivly delete the [XXXX] part
    in a ini-file?

    I know how to delete the "key=hello" part in an ini-file by using the "WritePrivateProfileSection" but that leaves the [XXXX] part in the ini-file. I want to get rid of that one too.

    Thank you
    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

  2. #2
    Lively Member
    Join Date
    Dec 1999
    Location
    Karlsruhe, Germany
    Posts
    122
    By writing it yourself, not with the API!

    Roger

  3. #3
    Fanatic Member
    Join Date
    Oct 1999
    Location
    MA, USA
    Posts
    523
    How about this API Function:
    Code:
    Private Declare Function OSWritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
       
    OSWritePrivateProfileString "XXXX", 0&, 0&, "C:\YOUR_INI_File.ini"
    HTH

    [Edited by QWERTY on 07-05-2000 at 02:56 PM]

  4. #4

    Thread Starter
    Hyperactive Member onerrorgoto's Avatar
    Join Date
    Aug 1999
    Location
    Sweden
    Posts
    330

    Thumbs up thank you

    Thank you Qwerty

    It works perfect.

    I also noticed that if I delet a heading with keyvalues in it, everything was deleted.

    This is what I have been looking for.

    Thanks again
    Onerrorgoto

    Dont be to optimistic, the light at the end of the tunnel might be a train

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