|
-
Mar 4th, 2004, 05:55 PM
#1
Thread Starter
Fanatic Member
read/write ini files
I want to use an ini file in my application.
In VB6 I would use the API calls
GetPrivateProfileString and WritePrivateProfileString. Does anyone know how to read/write ini files in .NET.
I looked on allapi but there is no .NET equivalent.
Does this mean there isn't one.
Other than the registry has .NET got any new and alternative methods than using ini files.
thanks for your patience.
-
Mar 4th, 2004, 10:26 PM
#2
Sleep mode
-
Mar 5th, 2004, 04:02 AM
#3
Thread Starter
Fanatic Member
I never thought about using XML.
I understand XML but there are so many uses.
The example is about database locations which is exactly what I wanted to store.
http://www.thescarms.com/dotNet/AppSettings.asp
many thanks
-
Apr 2nd, 2004, 10:55 AM
#4
Thread Starter
Fanatic Member
I used the example from TheScarms but when I run it in the IDE I get the following error
An unhandled exception of type 'System.NotSupportedException' occurred in system.dll
Additional information: Collection is read-only.
Has anyone any ideas.
-
Apr 2nd, 2004, 11:49 AM
#5
Sleep mode
Did you use any array obj ? Can you show the code that generates the error ?
-
Apr 5th, 2004, 03:08 AM
#6
Thread Starter
Fanatic Member
This is the code, more or less as it is from the site.
VB Code:
Dim a As Configuration.ConfigurationSettings
a.AppSettings.Add("PartsPath", "c:\ldraw\part")
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|