views:

40

answers:

1

i want to change application settings at runtime, here part of it:

<applicationSettings>
    <OPCClient.Properties.Settings>
        <setting name="Client_Service" serializeAs="String">
            <value>http://localhost/test/service.asmx&lt;/value&gt;
        </setting>
    </OPCClient.Properties.Settings>
</applicationSettings>

i want to modify this value, how can i do it?

+1  A: 

Have a look at the ConfigurationManager. The MSDN article gives an extensive example on its use, and it allows you to achieve exactly what you are wanting to do.

Also, a worthy note is that you need to add a reference to System.configuration.dll in your project to make use of the class.

Kyle Rozendo
i know about configurationmanager, but it doesnt show me this value
eba
i mean i cant find this value in configurationmanager
eba
@eba - Do you have access to changing the form of the configuration file?
Kyle Rozendo
yes, but now i can not change its form, because its used by another code in app
eba
i can not delete <OPCClient.Properties.Settings>
eba