Config Helper
WriteAppSetting Method
Example 



KellermanSoftware.ConfigHelper Namespace > ConfigReaderWriter Class : WriteAppSetting Method
Write a setting to the appSettings section. If it does not exist it will be added. If it does exist, the value will be replaced.
Syntax
Public Sub WriteAppSetting( _
   ByVal name As String, _
   ByVal value As String _
) 
Dim instance As ConfigReaderWriter
Dim name As String
Dim value As String
 
instance.WriteAppSetting(name, value)
public void WriteAppSetting( 
   string name,
   string value
)
public:
void WriteAppSetting( 
   String^ name,
   String^ value
) 

Parameters

name
value
Example
//Trial Mode
ConfigReaderWriter config = new ConfigReaderWriter();
 
//License Mode
//ConfigReaderWriter config = new ConfigReaderWriter("John Smith 10000", "psdfljksfdl==");
 
config.WriteAppSetting("MySettingName", "MySettingValue");
Console.WriteLine(config.ReadAppSetting("MySettingName"));
'Trial Mode
Dim config As New ConfigReaderWriter()
 
'License Mode
'Dim config As New ConfigReaderWriter("John Smith 10000", "psdfljksfdl==")
 
config.WriteAppSetting("MySettingName", "MySettingValue")
Console.WriteLine(config.ReadAppSetting("MySettingName"))
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

ConfigReaderWriter Class
ConfigReaderWriter Members