Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Save to app.config
Message
From
08/05/2007 14:48:01
 
 
To
08/05/2007 09:58:52
General information
Forum:
ASP.NET
Category:
Installation, Setup and Configuration
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01223375
Message ID:
01223540
Views:
24
Hi Stuart,

>I have the location of the database stored in the app.config file of my application. Once its deployed the user will have to map a network drive and then make sure the app.config is the same. I am using CllickOnce which buries the application deep in subfolders of the document and settings folder so there is no chance of anybody being able to find the app.config file to change it. What is the easiest and quickest way around this problem?

well, there IS actually a chance of somebody to find that folder, but it definitely takes some digging. For instance, one of the clickonce-deployed apps I have here is located under a folder that looks like this:
C:\docume~1\claudio\locals~1\Apps\2.0\M63O9MCG.XWN\ZGYKZWMA.ABD\wiki..tion_57bdbd698d9658ad_0002.0001_2997f894a15f262e
Anyways, what we do is to just create a UI within the application to edit those settings. Read the setting, put it on a textbox or whatever, let the user change it, and then save the settings, like so:
// read setting...
this.TextBox.Text = YourProject.Properties.Settings.Default.SomeSetting

// update setting...
YourProject.Properties.Settings.Default.SomeSetting = this.TextBox.Text;

// Save settings to disk
YourProject.Properties.Settings.Default.Save();
HTH
Claudio Lassala
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform