Advertisement
Advertisement
| 03.29.2008 at 05:21PM PDT, ID: 23280108 |
|
[x]
Attachment Details
|
||
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 03.30.2008 at 11:27AM PDT, ID: 21241472 |
| 03.30.2008 at 07:41PM PDT, ID: 21242862 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: |
//class members
ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
KeyValueConfigurationElement kvce;
Configuration config;
//constructor
public Form1()
{
InitializeComponent();
fileMap.ExeConfigFilename = fileMap.ExeConfigFilename = @"path_to_your_file";
config = configurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None) as Configruation;
//get some value from a key value in the configuration file...
txtSomeTextBoxValue.Text = config.AppSettings.Settings["someKeyVariable"].Value.ToString();
}
private void button_Click(object sender, EventArgs e)
{
kvce.value = txtSomeTextBoxValue.Text;
//save value of textbox back to the config file....
config.Save(ConfigurationSaveMode.Minimal, true);
}
}
|
| 03.31.2008 at 09:46AM PDT, ID: 21247025 |
| 03.31.2008 at 10:05AM PDT, ID: 21247190 |
| 03.31.2008 at 10:21AM PDT, ID: 21247318 |
| 03.31.2008 at 10:27AM PDT, ID: 21247356 |