A
Alan Silver
Hello,
I have a need to read the web.config file from another web site. I am
trying get the value of the "theme" attribute of the "pages" node.
I initially tried to do this by loading the file into an XmlDocument and
using SelectSingleNode with a path like
"/configuration/system.web/pages", but no matter what variation of the
path I tried, this gave a null object.
I ended up with...
XmlAttributeCollection pagesAttributes = webConfig.FirstChild.NextSibling.FirstChild["pages"].Attributes;
which works, but looks a little fragile to me. I would really prefer to
use a path. Anyone any advice? Thanks in advance.
I have a need to read the web.config file from another web site. I am
trying get the value of the "theme" attribute of the "pages" node.
I initially tried to do this by loading the file into an XmlDocument and
using SelectSingleNode with a path like
"/configuration/system.web/pages", but no matter what variation of the
path I tried, this gave a null object.
I ended up with...
XmlAttributeCollection pagesAttributes = webConfig.FirstChild.NextSibling.FirstChild["pages"].Attributes;
which works, but looks a little fragile to me. I would really prefer to
use a path. Anyone any advice? Thanks in advance.