configuration file

M

Maileen

Hi,

I would like to use a configuration file for my application.
usually i use an *.ini file for that which is from my point of view
easier for multi distribution site.
this configuration file can be set up in some way that after user can
redistribute it without any trouble.

From my point of view it's better than any registry value.
Because how to export very easily all keys and value from 1 PC to
another one ?

Anyway...does anyone have a better idea than using an *.ini file ?
i need to have something really easy to export / import for next
installation of my application on different places.

thanks a lot,
Maileen
 
O

One Handed Man \( OHM - Terry Burns \)

Yes, use the app.config file ( XML ), then you can use the
System.Configuration namespace to read your settings

Regards - OHM

--
OHM ( Terry Burns ) * Use the following to email me *

Dim ch() As Char = "ufssz/cvsotAhsfbuTpmvujpotXjui/OFU".ToCharArray()
For i As Int32 = 0 To ch.Length - 1
ch(i) = Convert.ToChar(Convert.ToInt16(ch(i)) - 1)
Next
Process.Start("mailto:" & New String(ch))
 
H

Herfried K. Wagner [MVP]

Maileen said:
I would like to use a configuration file for my application.
usually i use an *.ini file for that which is from my point of view
easier for multi distribution site.
this configuration file can be set up in some way that after user can
redistribute it without any trouble.

From my point of view it's better than any registry value.
Because how to export very easily all keys and value from 1 PC to
another one ?

Anyway...does anyone have a better idea than using an *.ini file ?
i need to have something really easy to export / import for next
installation of my application on different places.

If you are talking about configuration settings, then use an "App.config"
file.

If you are talking about user preferences:

Storing and loading user preferences
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=userpreferences>
 
R

Richard L Rosenheim

You can't save binary data directly to a XML file. But, you can convert the
image to a Base64 string and save the resulting string to the XML file.
 
G

Guest

Maileen, the easiest way that I have found (it came from someone on this
newsgroup) was to create a class using various properties to save all your
settings and user preferences and whatever else. When theh program exits,
serialize the class and save it to a file. When the application starts, read
the file and deserialize it back into the Class. You then have all your
settings and user preferences available thru the class properties.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top