I am creating an xml file that stores the values of GUI elements as key,value pairs. I am attaching the code snippet that I am using private static Hashtable appSettings;
static ConfigurationManager()
{
appSettings = new Hashtable();
}
public static void SetAppSetting(string key, string value)
{
appSettings[key] = value;
}
Before writing to the xml file, I am populating the appsettings Hashtable, from the GUI as below:
ConfigurationManager.SetAppSetting("A1", m_chkA1.Checked.ToString());
ConfigurationManager.SetAppSetting("A2", m_chkA2.Checked.ToString());// ? 1 : 0;
ConfigurationManager.SetAppSetting("A3", m_chkA3.Checked.ToString());// ? 1 : 0;
and then I write to the xml file. When I check the appSettings list, it shows in the below order. + ["A3"] "True"
+ ["A1"] "True"
+ ["A2"] "True"
I see that this is organized based on the hash code of the key but how do I arrange in the same order that I save ? Please suggest.