473,394 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Question: Getting app settings?

I suppose it's XML, but is there a way to easily parse/read app settings?

In ASP.NET I can use the '<appSettings>' section in the Web.config (by
calling the ConfigurationSettings.AppSettings method.) I would like to find
another similar way to do it in VB.NET.

Thanks.
Nov 20 '05 #1
2 3580
'xml file for user choice of connection
<?xml version="1.0" encoding="utf-8" ?>
<Section Name="Settings">
<Key Name="databasepath" Value="C:\database.mdb"/>
</Section>

Loading the file at startup of app....

Private Sub ReadXmlConfig()
' Create Xml Document and load the xml file
Dim xmlDoc As XmlDocument = New XmlDocument
xmlDoc.Load("C:\Neumann Plumbing and Heating\XMLDBPATH.xml") 'can
use appdirectory when finished with project.
' Read mail server value
Dim keyNodeList As XmlNodeList =
xmlDoc.DocumentElement.SelectNodes("Key")
Dim keyNode As XmlNode
For Each keyNode In keyNodeList
' Read the attributes...
Dim attribs As XmlAttributeCollection = keyNode.Attributes
Dim attrib As XmlAttribute = attribs("Name")
If attrib.Value = "databasepaths" Then
databasepath = attribs("Value").Value.ToString()
'MsgBox(databasepath)
End If
Next
End Sub

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
I suppose it's XML, but is there a way to easily parse/read app settings?

In ASP.NET I can use the '<appSettings>' section in the Web.config (by
calling the ConfigurationSettings.AppSettings method.) I would like to find another similar way to do it in VB.NET.

Thanks.

Nov 20 '05 #2
Thanks!

"scorpion53061" <sc************@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
'xml file for user choice of connection
<?xml version="1.0" encoding="utf-8" ?>
<Section Name="Settings">
<Key Name="databasepath" Value="C:\database.mdb"/>
</Section>

Loading the file at startup of app....

Private Sub ReadXmlConfig()
' Create Xml Document and load the xml file
Dim xmlDoc As XmlDocument = New XmlDocument
xmlDoc.Load("C:\Neumann Plumbing and Heating\XMLDBPATH.xml") 'can
use appdirectory when finished with project.
' Read mail server value
Dim keyNodeList As XmlNodeList =
xmlDoc.DocumentElement.SelectNodes("Key")
Dim keyNode As XmlNode
For Each keyNode In keyNodeList
' Read the attributes...
Dim attribs As XmlAttributeCollection = keyNode.Attributes
Dim attrib As XmlAttribute = attribs("Name")
If attrib.Value = "databasepaths" Then
databasepath = attribs("Value").Value.ToString()
'MsgBox(databasepath)
End If
Next
End Sub

"VB Programmer" <gr*********@go-intech.com> wrote in message
news:O6**************@tk2msftngp13.phx.gbl...
I suppose it's XML, but is there a way to easily parse/read app settings?
In ASP.NET I can use the '<appSettings>' section in the Web.config (by
calling the ConfigurationSettings.AppSettings method.) I would like to

find
another similar way to do it in VB.NET.

Thanks.


Nov 20 '05 #3

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

Similar topics

5
by: tvr | last post by:
Hi, I have an odd problem. The updates on my asp files are not reflected in the browser. Till recently everything was working fine. Today I installed new updates on my windows 2000. After...
1
by: Raed Sawalha | last post by:
I have two Question : 1) I created an installer project for my application and added it in User Program Menu=> i wondering how can I add UnInstall Action when install in User Program Menu. 2)...
1
by: Nikhil Patel | last post by:
Hi all, What is the best way to allow the administrator of the application to select which columns are displayed in a Databound grid in an aspx form. I was thinking of creating a form and display...
8
by: Scott Schluer | last post by:
Hello, I'm fairly experience with VB.NET in so far as it's syntax is concerned, however I'm coming from a web-based environment. Typically, when I want to store data (i.e. user preferences,...
8
by: Abubakar | last post by:
Hi, I am writing some unmanaged c++ code that would need to be compiled in the future using compilers other than vc++. I'm using the feature of vc++ "use precompiled headers", is there going to...
2
by: Laurent Bugnion | last post by:
Hi, I like to develop custom controls for a number of webpages. These controls are often customizable, so that they can be reused in a number of situations. My question is: What is the best...
6
by: WT | last post by:
Hello, Using VS2005. I have an assembly library that can be called from a Web site asp.net application or from a winform application. From this library I need to retrieve a path using simply a...
2
by: =?Utf-8?B?RGF2ZSBU?= | last post by:
I have a business logic web service that references an object library. No problem there. This object library needs to reference a data access web service. If I add a web reference to the DAL web...
1
by: Klerk | last post by:
I have a "device" (abstract class) with some "settings"(not sure if they should be a bunch of properties or a collection). Settings maybe readonly or read write. I have a "monitor" that polls the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.