Creating INI file

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Grace

    Creating INI file

    Hi,

    How do I create/access an INI file in VB .NET? I
    appreciate any help you can give me...

    Thanks!
  • Herfried K. Wagner [MVP]

    #2
    Re: Creating INI file

    * "Grace" <anonymous@disc ussions.microso ft.com> scripsit:[color=blue]
    > How do I create/access an INI file in VB .NET? I
    > appreciate any help you can give me...[/color]

    INI files are out of date.

    <http://www.mentalis.or g/soft/class.qpx?id=6>

    --
    Herfried K. Wagner [MVP]
    <http://www.mvps.org/dotnet>

    Comment

    • Russell Jones

      #3
      Re: Creating INI file

      It's true that INI files are out of date; nonetheless, people still need to
      read and write legacy INI files--and Microsoft still uses INI files
      extensively in its own programs. You can find more information here:


      And for the .NET way:




      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:bpl9j6$1o2 ktb$2@ID-208219.news.uni-berlin.de...[color=blue]
      > * "Grace" <anonymous@disc ussions.microso ft.com> scripsit:[color=green]
      > > How do I create/access an INI file in VB .NET? I
      > > appreciate any help you can give me...[/color]
      >
      > INI files are out of date.
      >
      > <http://www.mentalis.or g/soft/class.qpx?id=6>
      >
      > --
      > Herfried K. Wagner [MVP]
      > <http://www.mvps.org/dotnet>[/color]


      Comment

      • Armin Zingler

        #4
        Re: Creating INI file

        "Grace" <anonymous@disc ussions.microso ft.com> schrieb[color=blue]
        >
        > How do I create/access an INI file in VB .NET? I
        > appreciate any help you can give me...[/color]

        Have a look at the Get* and Write* functions:
        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.



        BTW, INI files are said to be obsolete:

        <quote>
        Note This function is provided only for compatibility with 16-bit
        Windows-based applications, therefore this function should not be called
        from server code. Applications should store initialization information in
        the registry
        </quote>


        How to use pinvoke:
        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.

        Find official documentation, practical know-how, and expert guidance for builders working and troubleshooting in Microsoft products.


        --
        Armin




        Comment

        • Sueffel

          #5
          Re: Creating INI file


          "Grace" <anonymous@disc ussions.microso ft.com> wrote in message
          news:0c6a01c3b0 3d$e39cbee0$a10 1280a@phx.gbl.. .[color=blue]
          > Hi,
          >
          > How do I create/access an INI file in VB .NET? I
          > appreciate any help you can give me...
          >
          > Thanks![/color]

          Yes, INI files are out of date. But two facts here, let me point out
          desktop.ini that still exists in WinXP. Also, INI files are a lot smaller
          than thier XML replacements. I am thinking of switching over to XML myself
          just because of the added features that XML offers. Also, alot of people
          say "Use the registry". I've never been a huge fan of that, plus, I'm
          testing out the Mono system, and I don't even want to think about the
          nightmares WINE and MONO will have witha psudo-registry, so I'm staying
          file-based.
          There are alot of options, but it comes down to personal preference, and
          no one should jump down anyone else's case for doing a personal preference.
          My suggestion Grace, if you want to still use legacy INI files, use the
          same API calls that VB6 would use, they work just fine. If you want to
          stick with file-based user settings, look into XML files, the offer so much
          more than a flat INI file would, but once again, it's personal preference.

          HTH
          Suefell


          ---
          Outgoing mail is certified Virus Free.
          Checked by AVG anti-virus system (http://www.grisoft.com).
          Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003


          Comment

          • Tom Shelton

            #6
            Re: Creating INI file

            On 2003-11-21, Sueffel <someone@somewh ere.com> wrote:[color=blue]
            >
            > "Grace" <anonymous@disc ussions.microso ft.com> wrote in message
            > news:0c6a01c3b0 3d$e39cbee0$a10 1280a@phx.gbl.. .[color=green]
            >> Hi,
            >>
            >> How do I create/access an INI file in VB .NET? I
            >> appreciate any help you can give me...
            >>
            >> Thanks![/color]
            >
            > Yes, INI files are out of date. But two facts here, let me point out
            > desktop.ini that still exists in WinXP. Also, INI files are a lot smaller
            > than thier XML replacements. I am thinking of switching over to XML myself
            > just because of the added features that XML offers. Also, alot of people
            > say "Use the registry". I've never been a huge fan of that, plus, I'm
            > testing out the Mono system, and I don't even want to think about the
            > nightmares WINE and MONO will have witha psudo-registry, so I'm staying
            > file-based.[/color]

            Mono is comming along very nicely... I'm currently working on a C#
            wrapper for then libncurses.so on my Gentoo Linux box. I think if one
            wants to stay as portable as possible, then XML based config files is
            the best way to go. Using legacy INI API calls just complicates things
            if you ever have to port.

            And for those that don't know - VB.NET will run on Mono, though the mono
            basic compiler (mbas) is not as complete as the C# compiler currently.

            --
            Tom Shelton
            [MVP - Visual Basic]

            Comment

            • Sueffel

              #7
              Re: Creating INI file


              "Tom Shelton" <tom@lsnfcdm.co m> wrote in message
              news:#z8TNDFsDH A.4088@TK2MSFTN GP11.phx.gbl...[color=blue]
              > On 2003-11-21, Sueffel <someone@somewh ere.com> wrote:[color=green]
              > >
              > > "Grace" <anonymous@disc ussions.microso ft.com> wrote in message
              > > news:0c6a01c3b0 3d$e39cbee0$a10 1280a@phx.gbl.. .[color=darkred]
              > >> Hi,
              > >>
              > >> How do I create/access an INI file in VB .NET? I
              > >> appreciate any help you can give me...
              > >>
              > >> Thanks![/color]
              > >
              > > Yes, INI files are out of date. But two facts here, let me point[/color][/color]
              out[color=blue][color=green]
              > > desktop.ini that still exists in WinXP. Also, INI files are a lot[/color][/color]
              smaller[color=blue][color=green]
              > > than thier XML replacements. I am thinking of switching over to XML[/color][/color]
              myself[color=blue][color=green]
              > > just because of the added features that XML offers. Also, alot of[/color][/color]
              people[color=blue][color=green]
              > > say "Use the registry". I've never been a huge fan of that, plus, I'm
              > > testing out the Mono system, and I don't even want to think about the
              > > nightmares WINE and MONO will have witha psudo-registry, so I'm staying
              > > file-based.[/color]
              >
              > Mono is comming along very nicely... I'm currently working on a C#
              > wrapper for then libncurses.so on my Gentoo Linux box. I think if one
              > wants to stay as portable as possible, then XML based config files is
              > the best way to go. Using legacy INI API calls just complicates things
              > if you ever have to port.
              >
              > And for those that don't know - VB.NET will run on Mono, though the mono
              > basic compiler (mbas) is not as complete as the C# compiler currently.
              >
              > --
              > Tom Shelton
              > [MVP - Visual Basic][/color]

              Good to hear that Mono's running, I have not as yet been able to get it
              to install. I'm running SuSE 8.1 on a VMWare, and the problem I'm having
              now is I had to install pkg-config, and now it's griping it can't find the
              variable and glib-2.0 Fun LMAO
              I really want to test out the mono-mod for Apache, that looks nifty to
              say the least.

              Suefell


              ---
              Outgoing mail is certified Virus Free.
              Checked by AVG anti-virus system (http://www.grisoft.com).
              Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003


              Comment

              • Tom Shelton

                #8
                Re: Creating INI file

                On 2003-11-21, Sueffel <someone@somewh ere.com> wrote:[color=blue]
                >
                > "Tom Shelton" <tom@lsnfcdm.co m> wrote in message
                > news:#z8TNDFsDH A.4088@TK2MSFTN GP11.phx.gbl...[color=green]
                >> On 2003-11-21, Sueffel <someone@somewh ere.com> wrote:[color=darkred]
                >> >
                >> > "Grace" <anonymous@disc ussions.microso ft.com> wrote in message
                >> > news:0c6a01c3b0 3d$e39cbee0$a10 1280a@phx.gbl.. .
                >> >> Hi,
                >> >>[/color][/color][/color]

                <snip>
                [color=blue][color=green]
                >> --
                >> Tom Shelton
                >> [MVP - Visual Basic][/color]
                >
                > Good to hear that Mono's running, I have not as yet been able to get it
                > to install. I'm running SuSE 8.1 on a VMWare, and the problem I'm having
                > now is I had to install pkg-config, and now it's griping it can't find the
                > variable and glib-2.0 Fun LMAO
                > I really want to test out the mono-mod for Apache, that looks nifty to
                > say the least.
                >
                > Suefell[/color]

                The ASP.NET implementation does look interesting, but I'm not normally a
                web guy (at least not anymore - and when I was, I was doing CGI with
                Perl). What I have been playing with is GTK# and now I'm using a lot of
                P/Invoke to wrap the ncurses library.

                If it's not to much trouble, I would switch distros. I had it running
                on RH9 with not to much trouble and getting it running on Gentoo was
                even easier:

                emerge mono gtk-sharp

                All done :) Mono is a really neat system. I hope that it doesn't
                suffer a legal demise do to the MS patents on the .NET api.

                --
                Tom Shelton
                [MVP - Visual Basic]

                Comment

                • Sueffel

                  #9
                  Re: Creating INI file


                  "Tom Shelton" <tom@lsnfcdm.co m> wrote in message
                  news:ONxLA5FsDH A.1184@TK2MSFTN GP10.phx.gbl...[color=blue]
                  > On 2003-11-21, Sueffel <someone@somewh ere.com> wrote:[color=green]
                  > >
                  > > "Tom Shelton" <tom@lsnfcdm.co m> wrote in message
                  > > news:#z8TNDFsDH A.4088@TK2MSFTN GP11.phx.gbl...[color=darkred]
                  > >> On 2003-11-21, Sueffel <someone@somewh ere.com> wrote:
                  > >> >
                  > >> > "Grace" <anonymous@disc ussions.microso ft.com> wrote in message
                  > >> > news:0c6a01c3b0 3d$e39cbee0$a10 1280a@phx.gbl.. .
                  > >> >> Hi,
                  > >> >>[/color][/color]
                  >
                  > <snip>
                  >[color=green][color=darkred]
                  > >> --
                  > >> Tom Shelton
                  > >> [MVP - Visual Basic][/color]
                  > >
                  > > Good to hear that Mono's running, I have not as yet been able to get[/color][/color]
                  it[color=blue][color=green]
                  > > to install. I'm running SuSE 8.1 on a VMWare, and the problem I'm[/color][/color]
                  having[color=blue][color=green]
                  > > now is I had to install pkg-config, and now it's griping it can't find[/color][/color]
                  the[color=blue][color=green]
                  > > variable and glib-2.0 Fun LMAO
                  > > I really want to test out the mono-mod for Apache, that looks nifty[/color][/color]
                  to[color=blue][color=green]
                  > > say the least.
                  > >
                  > > Suefell[/color]
                  >
                  > The ASP.NET implementation does look interesting, but I'm not normally a
                  > web guy (at least not anymore - and when I was, I was doing CGI with
                  > Perl). What I have been playing with is GTK# and now I'm using a lot of
                  > P/Invoke to wrap the ncurses library.
                  >
                  > If it's not to much trouble, I would switch distros. I had it running
                  > on RH9 with not to much trouble and getting it running on Gentoo was
                  > even easier:
                  >
                  > emerge mono gtk-sharp
                  >
                  > All done :) Mono is a really neat system. I hope that it doesn't
                  > suffer a legal demise do to the MS patents on the .NET api.
                  >
                  > --
                  > Tom Shelton
                  > [MVP - Visual Basic][/color]

                  I really doubt they will because from my research, the CLR does not fall
                  under the .NET patent, because it was created by someone else and remains
                  opensource, so does C# technically, although MS bought the rights to it.
                  This is all from research, so it may be partially conjecture. It may come
                  down to be similar to the situation between Linux and Sun Microsystems, so
                  it's hard to tell.
                  Hope it sticks around, because even if Linux get's a major foothold on
                  the market, it will allow MS to continue to be a big player in the field of
                  programming architecture.

                  Suefell


                  ---
                  Outgoing mail is certified Virus Free.
                  Checked by AVG anti-virus system (http://www.grisoft.com).
                  Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003


                  Comment

                  • Herfried K. Wagner [MVP]

                    #10
                    Re: Creating INI file

                    * Tom Shelton <tom@lsnfcdm.co m> scripsit:[color=blue][color=green]
                    >> desktop.ini that still exists in WinXP. Also, INI files are a lot smaller
                    >> than thier XML replacements. I am thinking of switching over to XML myself
                    >> just because of the added features that XML offers. Also, alot of people
                    >> say "Use the registry". I've never been a huge fan of that, plus, I'm
                    >> testing out the Mono system, and I don't even want to think about the
                    >> nightmares WINE and MONO will have witha psudo-registry, so I'm staying
                    >> file-based.[/color]
                    >
                    > Mono is comming along very nicely... I'm currently working on a C#
                    > wrapper for then libncurses.so on my Gentoo Linux box. I think if one
                    > wants to stay as portable as possible, then XML based config files is
                    > the best way to go. Using legacy INI API calls just complicates things
                    > if you ever have to port.[/color]

                    It's time that somebody provides a _managed_ implementation of Window's
                    INI file access...

                    SCNR

                    --
                    Herfried K. Wagner [MVP]
                    <http://www.mvps.org/dotnet>

                    Comment

                    • Tom Shelton

                      #11
                      Re: Creating INI file

                      On 2003-11-21, Herfried K. Wagner [MVP] <hirf-spam-me-here@gmx.at> wrote:[color=blue]
                      > * Tom Shelton <tom@lsnfcdm.co m> scripsit:[color=green][color=darkred]
                      >>> desktop.ini that still exists in WinXP. Also, INI files are a lot smaller
                      >>> than thier XML replacements. I am thinking of switching over to XML myself
                      >>> just because of the added features that XML offers. Also, alot of people
                      >>> say "Use the registry". I've never been a huge fan of that, plus, I'm
                      >>> testing out the Mono system, and I don't even want to think about the
                      >>> nightmares WINE and MONO will have witha psudo-registry, so I'm staying
                      >>> file-based.[/color]
                      >>
                      >> Mono is comming along very nicely... I'm currently working on a C#
                      >> wrapper for then libncurses.so on my Gentoo Linux box. I think if one
                      >> wants to stay as portable as possible, then XML based config files is
                      >> the best way to go. Using legacy INI API calls just complicates things
                      >> if you ever have to port.[/color]
                      >
                      > It's time that somebody provides a _managed_ implementation of Window's
                      > INI file access...
                      >
                      > SCNR
                      >[/color]

                      Sounds like a good idea... When can I expect you to have that done? :)

                      --
                      Tom Shelton
                      [MVP - Visual Basic]

                      Comment

                      • Éric Moreau

                        #12
                        Re: Creating INI file

                        I have created a small wrapper class around INI files (for compatibility
                        with older applications).

                        Have a look at http://www.utmag.com/May2003/Page59.asp

                        --


                        HTH

                        Éric Moreau, MCT, MCSD
                        Conseiller principal / Senior consultant
                        Concept S2i inc. (www.s2i.com)



                        "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                        news:e%23PEYrHs DHA.1744@TK2MSF TNGP12.phx.gbl. ..[color=blue]
                        > * Tom Shelton <tom@lsnfcdm.co m> scripsit:[color=green][color=darkred]
                        > >> desktop.ini that still exists in WinXP. Also, INI files are a lot[/color][/color][/color]
                        smaller[color=blue][color=green][color=darkred]
                        > >> than thier XML replacements. I am thinking of switching over to XML[/color][/color][/color]
                        myself[color=blue][color=green][color=darkred]
                        > >> just because of the added features that XML offers. Also, alot of[/color][/color][/color]
                        people[color=blue][color=green][color=darkred]
                        > >> say "Use the registry". I've never been a huge fan of that, plus, I'm
                        > >> testing out the Mono system, and I don't even want to think about the
                        > >> nightmares WINE and MONO will have witha psudo-registry, so I'm[/color][/color][/color]
                        staying[color=blue][color=green][color=darkred]
                        > >> file-based.[/color]
                        > >
                        > > Mono is comming along very nicely... I'm currently working on a C#
                        > > wrapper for then libncurses.so on my Gentoo Linux box. I think if one
                        > > wants to stay as portable as possible, then XML based config files is
                        > > the best way to go. Using legacy INI API calls just complicates things
                        > > if you ever have to port.[/color]
                        >
                        > It's time that somebody provides a _managed_ implementation of Window's
                        > INI file access...
                        >
                        > SCNR
                        >
                        > --
                        > Herfried K. Wagner [MVP]
                        > <http://www.mvps.org/dotnet>[/color]


                        Comment

                        • Herfried K. Wagner [MVP]

                          #13
                          Re: Creating INI file

                          * "Éric Moreau" <_NO-SPAM_eric.morea u@videotron.ca> scripsit:[color=blue]
                          > I have created a small wrapper class around INI files (for compatibility
                          > with older applications).
                          >
                          > Have a look at http://www.utmag.com/May2003/Page59.asp[/color]

                          I was talking about a completely managed re-implementation of the
                          Windows p/invoke calls which can be easily ported to other platforms
                          that don't support the Windows API.

                          --
                          Herfried K. Wagner [MVP]
                          <http://www.mvps.org/dotnet>

                          Comment

                          • Sueffel

                            #14
                            Re: Creating INI file


                            "Herfried K. Wagner [MVP]" <hirf-spam-me-
                            <SNIP>

                            Well, I'm working on a class that uses .cfx files. Basically, they are
                            XML implimentation of INI files, which provide the ability to have multiple
                            value for each key. I would love nothing more than to make this an API, but
                            that's not possible with VB.NET, or so I'm told. But, with it being a
                            class, I can shove that into a DLL, and then the Win32 API compatability is
                            no longer an issue, and it can be used under Mono/WinRack which has issues
                            with Windows Registry, or it could be used on Mac which has no registry.
                            Check back with me on my progress...

                            Sueffel


                            ---
                            Outgoing mail is certified Virus Free.
                            Checked by AVG anti-virus system (http://www.grisoft.com).
                            Version: 6.0.542 / Virus Database: 336 - Release Date: 11/18/2003


                            Comment

                            Working...