The trouble I'm having is the layout of the XML file (which I've included a sample below), I've trying to get the ServerIP, SiteName and ProjectName and store the value in the Property, I've setup a search using the type Attribute Name and result type attribute value but it's not matching, I assume because the value is actually a child or the parent, I cannot use Index because the multiple setting values can be in any orders.
Any ideas how I can achieve this?
Thanks in advance.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=XXXXX">
<section name="PROG.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=XXXXX" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<applicationSettings>
<PROG.Properties.Settings>
<setting name="ServerIP" serializeAs="String">
<!-- IP Address of the Server Hosting the REST End Point -->
<value>192.168.0.33</value>
</setting>
<setting name="SiteName" serializeAs="String">
<!-- Customer Site Name To Be Displayed in Database -->
<value>SITENAME VALUE</value>
</setting>
<setting name="ProjectName" serializeAs="String">
<!-- Project Name To Be Displayed in Database -->
<value>PROJECT NAME</value>
</setting>
<setting name="EndPointUser" serializeAs="String">
<!-- User Protecting REST Endpoint using htaccess authentication -->
<value>restservice</value>
</setting>
<setting name="EndPointPassword" serializeAs="String">
<!-- Password for REST Endpoint Protection -->
<value>PASSWORD</value>
</setting>
<setting name="RequestTimeOutsecs" serializeAs="String">
<!-- Server Timeout Reporting to REST Service, Increase if Initial Connection is Slow -->
<value>30</value>
</setting>
</PROG.Properties.Settings>
</applicationSettings>
</configuration>