473,511 Members | 15,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using a Xml Reader

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
Nov 16 '05 #1
3 1503
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/de...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" <an*******@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
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 I do that with XML? I might be making this harder than it is, but I just haven't found a simple "...do this, and get this back" type of example?

Any help, samples, snippets appreciated,

TIA,
Ray K.


Nov 16 '05 #2
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" <an*******@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
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 I do that with XML? I might be making this harder than it is, but I just haven't found a simple "...do this, and get this back" type of example?

Any help, samples, snippets appreciated,

TIA,
Ray K.

Nov 16 '05 #3
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" <an*******@discussions.microsoft.com> wrote in message
news:AE**********************************@microsof t.com...
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 I do that with XML? I might be making this harder than it is, but I just haven't found a simple "...do this, and get this back" type of example?

Any help, samples, snippets appreciated,

TIA,
Ray K.

Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
21368
by: Junior | last post by:
I keep receiving this "The type or namespace name 'CASsEventHandler' could not be found (are you missing a using directive or an assembly reference?)" message in two particular lines, and I've...
5
1775
by: BobC | last post by:
Article ID: 301225 I can't seem to get this code to work. I modified it alittle so I could try and figure out the exception. I keep getting an error on the " Do While (reader.Read()) " statement....
12
11139
by: Jerry Camel | last post by:
Not sure if this is a good place to post this... I'm writing and ASP.net app using vb .net. I need to interact with a credit card reader. I have one that sits inline with the keyboard. Works...
7
18123
by: wk6pack | last post by:
Hi, I would like to know how to parse the following xml string using vb.net? currxml=" <employee><address_2></address_2><assignments><assignment><assigned_bargaini...
10
2105
by: INeedADip | last post by:
Can anyone here confirm for sure that reader.Close() and Dispose() will get called using the following routine: using(SqlDataReader reader = GetOpenReaderFunction()) { while(reader.Read())...
1
831
by: Peter Nofelt | last post by:
Hey All, I am having issue with serializing a class and its base class using ..net 2.0. I am using IXmlSerializable I've provided code displaying my at the bottom of this post. Thanks ahead...
1
3076
by: eric.olstad | last post by:
I have discovered a bug in XmlBookmarkReader (code provided by MSDN, but not necessarily supported by Microsoft). The article is found here:...
6
4899
by: Alec MacLean | last post by:
Hi, I've created a small application for our company extranet (staff bulletins) that outputs a list of links to PDF's that are stored in a SQL table. The user clicks a link and the PDF is...
0
1401
by: ccshine | last post by:
I'm working on an app that implements a Structure to store a recordset in an ArrayList. I used this setup to bind to a DataGrid and it worked out so well, I thought it might be a better solution...
1
8548
by: Barry L. Camp | last post by:
Hi all, Wondering if someone can help with a nagging problem I am having using a GridView and an ObjectDataSource. I have a simple situation where I am trying to delete a row from a table, but...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.