|
-
Dec 4th, 2003, 03:05 AM
#1
Thread Starter
Addicted Member
Simple way of using XML as Config File? (VB6)
Hi i was just wondering if there is a simple way to use xml as a application configuration file in VB6.
Can someone show me how to put a xml file into varibles i mean like
timeout would be equal to the value of <Timeout> in the xml i am using below is my xml
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<CONFIG>
<Network>
<IP>80</IP>
<HOST>127.0.0.1</HOST>
<Timeout>12</Timeout>
</Network>
<General>
<Auto>1</Auto>
<ONTOP>True</ONTOP>
</General>
</CONFIG>
and my vb code so far i am using XML 2.6
VB Code:
Dim xml As MSXML2.XMLDocument
Set xml = New MSXML2.XMLDocument
xml.url = App.Path & "\config.xml"
Last edited by señorbadger; Dec 4th, 2003 at 03:09 AM.
-
Dec 4th, 2003, 04:31 AM
#2
Frenzied Member
Something wrong with .ini files?
-
Dec 4th, 2003, 04:34 AM
#3
Thread Starter
Addicted Member
you just nedd huge amounts of code for them and they a bit old now
-
Dec 4th, 2003, 04:36 AM
#4
Frenzied Member
Not really, just use a text file and call it an ini file.
Parsing out xml is somehow going to be less code and faster?
-
Dec 4th, 2003, 04:39 AM
#5
Thread Starter
Addicted Member
ok so if i changed a setting how would i tell it to update
ill forget the xml thing now just when i saw the code for a ini file i was shocked
-
Dec 4th, 2003, 04:42 AM
#6
Frenzied Member
You could just hold the settings in an Array, then write them to a file when you want to save them. If done properly, everything will hold the same indexes.
-
Dec 4th, 2003, 04:43 AM
#7
Thread Starter
Addicted Member
true true, thanks for ya help mate
-
Dec 4th, 2003, 04:48 AM
#8
Frenzied Member
Anytime. Mind you, it's all just suggestions. You naturally should always do things the way you want them done.
Hell, MSN uses XML config files.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|