0

I use an ini file in another language to load user settings into an application. However, I see that C# does not natively support ini files, and favours xml.

My problem is I've never worked with xml and Im new to C#.

What I have been looking for (unsuccessfully) is an example of C# dynamically loading data from an xml, and writing data to same.

I'd be grateful for an example or a link to one, or any other method to achieve same.

Suze.

edit --

example of my needs.

[SECTION]
array1=a,b,c,d,e,f,g
array2=h,i,j
array3=k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z

This section could have a varying number of keys and each key can have a varying length string, which I would normally read into an array, which would be created at runtime.

I have to admit that this is scaring me a little in C#.

Edited by Suzie999: extra info added

2
Contributors
1
Reply
4
Views
7 Years
Discussion Span
Last Post by nick.crane
0

You might want to consider using the application Settings. (Properties Settings Tab)

There are two types of settings, Application and User.

User settings are specific to the current user and it is possible to read/write User settings.
These are generally used to save user configurable options.

Application settings are read only and available to all users.
These are generally used to enable settings such as database connection strings to be overriden for a specific installation.

Both sets of settings support various types: including a StringCollection.
They are available to read(write) using Properties.Settings.Default.<settingName>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.