INI file equivalent in .NET


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: INI file equivalent in .NET

  1. #1
    John Hauppa Guest

    INI file equivalent in .NET


    Does anyone know if .ini files are still supported in .NET? And, if not, is
    there a fast equivalent for getting key-value pairs out of a text file?

    I have been scouring the help files and the net but I have not found anything
    yet.

    I would rather not use XML because I am sure that it is going to be slower
    than the old GetPrivateProfileString API call.

    Thanks,
    John


  2. #2
    Matthew Solnit Guest

    Re: INI file equivalent in .NET

    "John Hauppa" <hauppaj@modularis.com> wrote in message
    news:3c864896$1@10.1.10.29...
    > I would rather not use XML because I am sure that it is going to be slower
    > than the old GetPrivateProfileString API call.


    You're sure eh? ;-) Try it and see. And think about how many times you're going
    to be calling these files. Does a 10ms difference really matter when the
    program is first starting up? If you're reading from an INI file lots of times
    in a loop or something, then it's really more of a design flaw IMO.

    Also, XML gives you a very nice hierarchical structure for storing data, which
    can be more organized than using INI files.

    -- Matthew Solnit



  3. #3
    Arvind Guest

    Re: INI file equivalent in .NET


    "Matthew Solnit" <msolnit@y@hoo.c0m> wrote:
    >"John Hauppa" <hauppaj@modularis.com> wrote in message
    >news:3c864896$1@10.1.10.29...
    >> I would rather not use XML because I am sure that it is going to be slower
    >> than the old GetPrivateProfileString API call.

    >
    >You're sure eh? ;-) Try it and see. And think about how many times you're

    going
    >to be calling these files. Does a 10ms difference really matter when the
    >program is first starting up? If you're reading from an INI file lots of

    times
    >in a loop or something, then it's really more of a design flaw IMO.
    >
    >Also, XML gives you a very nice hierarchical structure for storing data,

    which
    >can be more organized than using INI files.
    >
    >-- Matthew Solnit
    >
    >


    Hi there,
    Did u try the web.config file that is automatically created when a project
    is created in Visual Studio .NET, this is created only if ur creating web
    applications.

    Try this, open the web.config file and enter the below statement
    between </system.web> and </configuration> (at the end of the file).

    <appSettings>
    <add key="strVal" value="This is a test !!"/>
    </appSettings>

    In a method use this to read the data from the config file
    string stringVal = System.Configuration.ConfigurationSettings.AppSettings["strVal"]

    -Arvind

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center