Hi Chris,
Reading and parsing the XML file seems like the best idea. You can use the
code below to do it, it's taken from a CF app but it does what you want.
XmlDocument xSettings = new XmlDocument();
xSettings.Load(new System.IO.StreamReader(configPath));
foreach(XmlNode node in xSettings["configuration"]["appSettings"])
{
switch(node.Attributes["key"].Value)
{
case "RASEntryName":
node.Attributes["value"].Value = entryName;
break;
case "RASPhoneNumber":
node.Attributes["value"].Value = phoneNumber;
break;
case "RASUsername":
node.Attributes["value"].Value = userName;
break;
case "RASPassword":
node.Attributes["value"].Value = password;
break;
Cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"christopher green" <us************@yahoo.com> wrote in message
news:uZ****************@TK2MSFTNGP09.phx.gbl...
I have a solution that comprises a web based project and a console
application. Web.Config holds attributes that I want to access from my
console application, can anyone advise me as to how to do this?
Restructuring the project to put the values into a database is not an
option.
Is there someway of invoking a web context to allow access to web.config
or should I use a FileStream and read web.config into an xml doc and
parse? If so does any one have any examples of the xml?
Many thanks.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!