Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8443419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:08:01+00:00 2026-06-10T09:08:01+00:00

Basically I have a C# application that has certain settings that I want any

  • 0

Basically I have a C# application that has certain settings that I want any user to be able to change but I want these settings to apply to all users. (The exact implementation is for computer-specific but not user-specific items like folder paths and com ports, etc) So far I have implemented this using appSettings and it has been working well but this breaks down when a user does not have permission to write to the Program Files directory.

I’m looking for suggestions on how to best handle this situation either utilizing appSettings, userSettings, or values in the registry. Whatever solution I use has to work for users that are not administrators as well as those that are. What would be considered a ‘best practice’ for this type of requirement?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:08:03+00:00Added an answer on June 10, 2026 at 9:08 am

    I will try to write an XML file containing all the settings that need to be read/written.
    This file could be saved in a well known folder like ProgramData (using Enviroment.SpecialFolder.CommonApplicationData)

    The easyest way to do this is using the builtin methods of a datatable WriteXml and ReadXml.
    You could implement a class that internally Load and Save your settings using a datatable and offer methos to retrive and set individual settings (rows in the datatable);

    public class MyAppSettings
    {
        // Where to store your settings
        private DataTable _storage = null;
    
        public MyAppSettings()
        {
           string settingFile = Path.Combine(Environment.GetFolderPath
                                (Environment.SpecialFolder.CommonApplicationData), 
                                "MyAppName", "MyAppSettings.xml");
           _storage = new DataTable();
           _storage.ReadXml(settingFile);
        }
        public void Save()
        {
           string settingFile = Path.Combine(Environment.GetFolderPath
                                (Environment.SpecialFolder.CommonApplicationData), 
                                "MyAppName", "MyAppSettings.xml");
           _storage.WriteXml(settingFile);
        }
    
        public string GetValue(string settingName)
        {
            // Code to search the base table
        }
        public void SetValue(string settingName, string settingValue)
        {
            // Code to update/insert the base table
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Rails application that I want to be able to jump to
I have a simple application that has richTextBox and button. User enters numbers(integers) into
I have an application that shows data from a MySQL table. Basically, my application
I have a Java program that generates Java classes for my application. Basically it
I want to get all the Applications that have intentlisteners to Intent.CATEGORY_HOME so basically
I have an application for scheduling certain events. And all these events must be
We have an old asp.net application that has no unit tests, integration tests, component
I have just made my first proper little desktop GUI application that basically wraps
Basically I have two applications: a PHP web application that runs over Apache and
We have an application that has one or more text console windows that all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.