Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application Settings pieces
Message
From
10/07/2006 17:57:23
Timothy Bryan
Sharpline Consultants
Conroe, Texas, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Application Settings pieces
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01135159
Message ID:
01135159
Views:
59
I am trying to figure out how all the pieces work to use the settings functionality. I have a few specific settings I need to have access to in my app as well as an interface for the user to set them.

I created a subclass of mmAppConfiguration
public class TipTraxConfig : mmAppConfiguration

private string configFilePath = Application.StartupPath + @"\config\";

I added some public fields like
public string CompanyID = "WMT";
public string TruckID = "004";
public bool EnableCurbScale = true;
etc, etc...

In the constructor I have
this.SetConfigurationSection("TipTraxConfig");
this.ReadKeysFromConfig(configFilePath + "TipTrax.config");

Now I have a form that instantiates this class and accesses the fields just fine. But they are not written to the XML or retrieved from there. I need them to be persistent. I am obviously missing something.

TipTraxConfig config = new TipTraxConfig();
// Refresh from settings the text boxes
this.txtCompanyID.Text = config.CompanyID;
this.txtTruckID.Text = config.TruckID;
etc, etc...

I thought the above "ReadKeysFromConfig(configFilePath);" would be the mechanism to read these in from the config xml. Thanks for any help.
Tim
Timothy Bryan
Next
Reply
Map
View

Click here to load this message in the networking platform