Results 1 to 7 of 7

Thread: How can I read and modify a INI file

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    7

    Question How can I read and modify a INI file

    I want to make a program that modifies INI files, but I don't know how to make, How can I access the Sections, and the Keys??

    Thanks.

  2. #2
    New Member Varadero's Avatar
    Join Date
    Aug 2002
    Posts
    7
    I have a DLL written in VB6 that works with inifiles.
    I think the functions you need are in that DLL.

    You can use this DLL in VB.NET.
    I haven't tried converting the DLL to .NET yet.

    If you want to I can give it to you.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Posts
    7
    Can you send me the code? and I will try to convert the .dll of VB 6 to .NET, if you can't send me the code I am interested anyway.

    Thanks.

    mailto: [email protected]

  4. #4
    New Member Varadero's Avatar
    Join Date
    Aug 2002
    Posts
    7
    I'll see what i can do.

  5. #5
    Lively Member
    Join Date
    Aug 2002
    Location
    India
    Posts
    97
    You can use the SetPrivateProfile,GetPrivateProfile functions to read and write to INI files
    \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
    Dont quote anyone if you can help it -
    THM
    /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

  6. #6
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    i saw i think in gotdotnet.com a class for reading them

  7. #7
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    not to downplay ini, but ini has been replaced by XML now. Developers more often use xml these days for configuration files. Also you can store all your config data and use a technique called Serialization to easily save the array's state to an xml file and restore/save it when need be.
    Ini is still fine, but you really should look into XML when you have the time.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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