GetPrivateProfileString any managed method?

  • Thread starter Thread starter Robains
  • Start date Start date
R

Robains

I have a lot of files I use to store application settings that are NOT
part of the registery (and should NOT be). Can't seem to find a .NET
Framework equivalent of GetPrivateProfileString -- I need to be able
to specify my own file location (C:\MyApp\MyApp.INI) and read values
from this file.

There is Microsoft.Win32 but that only seems to have registery
specific methods.

Rob.
 
You'll need to use P/Invoke. Try here:
http://www.mentalis.org/soft/class.qpx?id=6>.

Robains said:
I have a lot of files I use to store application settings that are NOT
part of the registery (and should NOT be). Can't seem to find a .NET
Framework equivalent of GetPrivateProfileString -- I need to be able
to specify my own file location (C:\MyApp\MyApp.INI) and read values
from this file.

There is Microsoft.Win32 but that only seems to have registery
specific methods.

Rob.



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption
=---
 
Rob,

As Ed suggested you can use P/Invoke, but if you want to stick with pure
..NET you could use XML files to store your configuration settings.

Check the XmlTextWriter and XmlTextReader classes in the documentation.

Gabriele
 
Back
Top