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 6897089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:07:32+00:00 2026-05-27T07:07:32+00:00

In my C# project, I have a user scoped setting for a folder path

  • 0

In my C# project, I have a user scoped setting for a folder path which I want to set at design time so that it becomes the default value for new users (If i am not mistaken).

I want to set the default value to one of the user AppData folder. What do I key as the value in the settings? I am refering to the MSVS Settings.settings UI when you double click it in the Solution Explorer (not sure what it is called).

The value should be one that is returned by, for example, Application.UserAppDataPath

(Please read in conjunction with my other question: C# difference between Environment.SpecialFolders and Application folders as to what path I should use)

Thanks!

UPDATE:

With shf301’s answer, I went inside settings.designer.cs and did this:

[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string LogFolder {
    get {
        return ((string)(this["LogFolder"])) ?? System.Windows.Forms.Application.LocalUserAppDataPath;
    }
    set {
        this["LogFolder"] = value;
    }
}
  • 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-05-27T07:07:33+00:00Added an answer on May 27, 2026 at 7:07 am

    You don’t key anything into the settings because you can’t know the user’s AppData folder. Leave the default value empty and in your code where you use the setting, if the setting is not set (a null or empty string) then use Application.UserAppDataPath otherwise use the users settings.

    For example:

    public static string GetUserPath()
    {
        string path = Settings.Default.UserPath;
        if (string.IsNullOrEmpty(path))
            path = Application.UserAppDataPath;
        return path;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a project that uses MOSS 2007. We have user profiles set
I have a project where the requirements is that a end user will select
I have a project to create a program, which prevents the user from escaping
I’m working on a project and have developed the high level user requirements for
I have a Project model similar to: class Project(models.Model): ... lead_analyst=models.ForeignKey(User, related_name='lead_analyst') ... I
I have a Winforms project with a bunch of User controls. I'd like the
I have to start a new project where user authentication/management will be required. A
I have a scene in my WPF project with about 2000 different user controls:
I have a Qt/C++ project and an old VB6 project. The user base might
I have quite a large VB6 project, with many forms, classes, modules and user

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.