Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Application Settings pieces
Message
De
10/07/2006 17:57:23
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Application Settings pieces
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Divers
Thread ID:
01135159
Message ID:
01135159
Vues:
61
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform