namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
ManagementObject appSet= new ManagementObject("root//NetFrameworkV1:appSettings.Directive=/"add/",key=/"test/",Selector=/" file://C:/Inetpub/wwwroot/MyWebApp/web.config/"");
Console.WriteLine(string.Format("Old value:{0}",appSet["value"]));
appSet.SetPropertyValue("value","new value was set ok!");
appSet.Put();
Console.WriteLine("New value setted ok!");
Console.Read();
}
}
}
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
ManagementObject appSet= new ManagementObject("root//NetFrameworkV1:appSettings.Directive=/"add/",key=/"test/",Selector=/" file://C:/Inetpub/wwwroot/MyWebApp/web.config/"");
Console.WriteLine(string.Format("Old value:{0}",appSet["value"]));
appSet.SetPropertyValue("value","new value was set ok!");
appSet.Put();
Console.WriteLine("New value setted ok!");
Console.Read();
}
}
}