Alex
Fri May 14 18:14:49 CDT 2004
Few things:
1) AppSettings is a static member that represents the contents of a
particular file: appname.exe.config.
2) To use this class with an arbitrary file do the following:
Dim o As New OpenNETCF.Configuration.ConfigurationSettings
o.FilePath = "\Program Files\OpenNETCFApplication1\XMLFile1.xml"
o.Read()
MsgBox(CStr(o.List.Keys.Count))
--
Alex Feinman
---
Visit
http://www.opennetcf.org
"Jesse" <jaufiero@cascodev.com> wrote in message
news:evsw7tSOEHA.3884@TK2MSFTNGP12.phx.gbl...
> After successfully installing the OpenNETCF SDK, I created an "OpenNETCF"
> project. I added an xml file to the project called "XMLFile1.xml".
>
> The xml file has the following text:
> <?xml version="1.0" encoding="utf-8" ?>
>
> <configuration>
>
> <appSettings>
>
> <add key="WebServiceURL"
> value="
http://10.0.0.73/WebService1/Service1.asmx" />
>
> <add key="Key 2" value="app Settings Value 2" />
>
> <add key="Key 3" value="app Settings Value 3" />
>
> </appSettings>
>
> </configuration>
>
>
> I added the following code behind a button in the application:
>
>
> Dim o As New OpenNETCF.Configuration.ConfigurationSettings
>
> o.FilePath = "\Program Files\OpenNETCFApplication1\XMLFile1.xml"
>
> MsgBox(CStr(o.AppSettings.Keys.Count))
>
>
>
> I would expect to get "3". Instead I get "0". The file path is correct.
> Any ideas?
>
>
>
> Thanks,
>
> Jesse
>
>
>
>
> "Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message
> news:OMqtdj5NEHA.2244@tk2msftngp13.phx.gbl...
> > OpenNETCF.Configuration
> >
> > --
> > Alex Feinman
> > ---
> > Visit
http://www.opennetcf.org
> >
> > "Jesse" <jaufiero@cascodev.com> wrote in message
> > news:OyUSqZ5NEHA.3596@tk2msftngp13.phx.gbl...
> > > Any suggestions for an alternative approach to application
> > configurability?
> > > Preferably some kind of utility assembly that is wrapped nicely.
> > >
> > > I downloaded a utility from
> >
http://www.codeproject.com/netcf/SmartConfig.asp
> > > but it proved to be very difficult to work with.
> > >
> > > Thanks,
> > > Jesse
> > >
> > >
> >
> >
>
>