Using a Xml Reader

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all

So far I'm finding that trying to use XML instead of .INI files is proving to be a little more difficult
For instance, if I wanted a string from an .INI file, I would use 'GetPrivateProfileString' , feed it primaril
the section and the key I wanted, and it would return the string associated with that key. Now, how d
I do that with XML? I might be making this harder than it is, but I just haven't found a simple "...d
this, and get this back" type of example

Any help, samples, snippets appreciated

TIA

Ray K
 
Hello,

I'd suggest you use the AppSettingsReader if you want XML-enabled
replacement for INI files. I think there should be a plenty of examples on
using XML configurations files in MSDN.

Consider the following URL as a kind of start page (mind the line wraps) and
pay special attention to topic s related to configuring application
settings:

http://msdn.microsoft.com/library/d...guringnetframeworkapplications.asp?frame=true

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

raykos said:
Hello all,

So far I'm finding that trying to use XML instead of .INI files is
proving to be a little more difficult.
For instance, if I wanted a string from an .INI file, I would use
'GetPrivateProfileString' , feed it primarily
the section and the key I wanted, and it would return the string
associated with that key. Now, how do
 
Hi Ray,

Why don't you use the config capabilities provided by the framework?

IF you need read/write capability from the program then IMHO the best way
is to use something like a Hashtable and serialization , I haven't found a
simple way of doing this.
IIRC yesterday was a thread regarding this too, maybe you should check it.


Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

raykos said:
Hello all,

So far I'm finding that trying to use XML instead of .INI files is
proving to be a little more difficult.
For instance, if I wanted a string from an .INI file, I would use
'GetPrivateProfileString' , feed it primarily
the section and the key I wanted, and it would return the string
associated with that key. Now, how do
 
Hi again,

I suggested in a previous post the use hf Hash to keep configuration
settings, it;s not true, you would get better results with
NameValueCollection.

Sorry for that, too early in the morning and not enough coffee yet :D
Going to get some cuban coffee ;)

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


raykos said:
Hello all,

So far I'm finding that trying to use XML instead of .INI files is
proving to be a little more difficult.
For instance, if I wanted a string from an .INI file, I would use
'GetPrivateProfileString' , feed it primarily
the section and the key I wanted, and it would return the string
associated with that key. Now, how do
 

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

Back
Top