The .NET Framework 2.0 allows you to
create and access values that are persisted between application execution
sessions. These values are called settings.
Suppose we have this setting in <AssemblyName>.exe.config file associated with your application
<setting name="MyTest" serializeAs="String"> <value>0</value>
</setting>
Value of this setting can be retrieved at runtime using following code:
string sTest= Properties.Settings.Default.MyTest;
To update value in setting use following:
Properties.Settings set = Properties.Settings.Default;
set.MyTest = "Test123";
Suppose we have this setting in <AssemblyName>.exe.config file associated with your application
<setting name="MyTest" serializeAs="String"> <value>0</value>
</setting>
Value of this setting can be retrieved at runtime using following code:
string sTest= Properties.Settings.Default.MyTest;
To update value in setting use following:
Properties.Settings set = Properties.Settings.Default;
set.MyTest = "Test123";
No comments:
Post a Comment