How to delete an ini file's section and its data in C#?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?UHVjY2E=?=

    #1

    How to delete an ini file's section and its data in C#?

    Hi, I'm using vs2005 and .net 2.0 for a windows C# applicaiton. How can I
    delete an ini file's section and its data in C#? Is there a .net funciton I
    can call? Also, Is there a way to find out how many key & value entry under
    a section in a ini file? Thank you.
    --
    Thanks.
  • Fredo

    #2
    Re: How to delete an ini file's section and its data in C#?

    I don't believe .NET has built-in code for dealing with ini files. You can
    p/Invoke into the Windows API to deal with .INI files or you can write your
    own (and I know there are libraries out there for .NET for doing it. Just
    google "C# ini library" or something like that).

    The .INI is about the most trivial file format out there, though. It
    wouldn't be that hard to do everything you're talking about in your own
    code.

    "Pucca" <Pucca@discussi ons.microsoft.c omwrote in message
    news:B043FA49-FE81-4A27-B422-8DD63B238997@mi crosoft.com...
    Hi, I'm using vs2005 and .net 2.0 for a windows C# applicaiton. How can I
    delete an ini file's section and its data in C#? Is there a .net funciton
    I
    can call? Also, Is there a way to find out how many key & value entry
    under
    a section in a ini file? Thank you.
    --
    Thanks.

    Comment

    • =?Utf-8?B?UHVjY2E=?=

      #3
      Re: How to delete an ini file's section and its data in C#?

      Thank you.
      --
      Thanks.


      "Fredo" wrote:
      I don't believe .NET has built-in code for dealing with ini files. You can
      p/Invoke into the Windows API to deal with .INI files or you can write your
      own (and I know there are libraries out there for .NET for doing it. Just
      google "C# ini library" or something like that).
      >
      The .INI is about the most trivial file format out there, though. It
      wouldn't be that hard to do everything you're talking about in your own
      code.
      >
      "Pucca" <Pucca@discussi ons.microsoft.c omwrote in message
      news:B043FA49-FE81-4A27-B422-8DD63B238997@mi crosoft.com...
      Hi, I'm using vs2005 and .net 2.0 for a windows C# applicaiton. How can I
      delete an ini file's section and its data in C#? Is there a .net funciton
      I
      can call? Also, Is there a way to find out how many key & value entry
      under
      a section in a ini file? Thank you.
      --
      Thanks.
      >
      >
      >

      Comment

      Working...