What's the best method to save preferences of a program? could you give me a sample?

What's the best method to save preferences of a program? could you give me a sample?


After I have set some preferences of a program, I hope to save them to disk, when the program restart,
the preferences can be restore. there are some type preferences such as string, boolean, number, etc...
What's the best method to save preferences of a program?

Maybe there are the following methods:

1. save them to the Registry of Windows

2. save to XML file

3. save to INI file. BTW, could you give me a sample how to read and write INI file with C#?

[598 byte] By [CUIWEI] at [2007-12-16]
# 2
Hi,

I'm writing a small xml file too. you can load it into a dataset at the begining of your app abd use the values.

rgerbig at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...
# 3
[DllImport("kernel32")]
The function in this dll.
Ha, I forgot the FullName, Sorry!
Hedda at 2007-9-9 > top of Msdn Tech,Visual C#,Visual C# General...