@dheerajjoshim
hi
the code u sent is for the key and value that were in app.config file
but what i want to retrieve is....to retrieve key and value that are externally written using some writing into app.config file codes
just check the code below
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(Configur ationUserLevel.None);
/* XmlDocument doc =
XmlNode node = doc.SelectSingleNode("//appSettings");*/
string c = config.AppSettings.Settings["secondname"].Value = "100";
//string k =Keys(config.AppSettings.Settings["govinda"].Value) = "modifiedvalue";
//config.AppSettings.Settings.Add("ModificationDate" , DateTime.Now.ToLongTimeString() + " ");
//textBox2.Text = c;
string[] keys = appSettings.AllKeys;
config.AppSettings.Settings.Add("srinu","100");
config.Save(ConfigurationSaveMode.Modified);
String myVal = System.Configuration.ConfigurationSettings.AppSett ings["100"].ToString();
textBox1.Text = keys[1];
textBox2.Text = myVal;
here "keys" is an array having only 2 values means upto keys[1] it exists
but when i give textBox1.Text = keys[2];
it is showing error eventhough i have written another "srinu" key into config file