Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. how to put user specific settings in an app.config file?

how to put user specific settings in an app.config file?

Scheduled Pinned Locked Moved .NET (Core and Framework)
tutorialquestionworkspace
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    orinoco77
    wrote on last edited by
    #1

    I want to be able to put an entry in my app.config so that, regardless of the user running the app, it will still point to their "My Documents" folder. The user's PCs are very locked down, and all they have access to is that folder, but obviously that folder is in a different location on every PC. Is there a way to use an environment variable or something, so that it always points at "My Documents" for the current user, wherever that is?

    M 1 Reply Last reply
    0
    • O orinoco77

      I want to be able to put an entry in my app.config so that, regardless of the user running the app, it will still point to their "My Documents" folder. The user's PCs are very locked down, and all they have access to is that folder, but obviously that folder is in a different location on every PC. Is there a way to use an environment variable or something, so that it always points at "My Documents" for the current user, wherever that is?

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      <blockquote class="FQ"><div class="FQA">orinoco77 wrote:</div>Is there a way to use an environment variable or something, so that it always points at "My Documents" for the current user</blockquote>

      Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      O 1 Reply Last reply
      0
      • M Mark Salsbery

        <blockquote class="FQ"><div class="FQA">orinoco77 wrote:</div>Is there a way to use an environment variable or something, so that it always points at "My Documents" for the current user</blockquote>

        Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        O Offline
        O Offline
        orinoco77
        wrote on last edited by
        #3

        Hmm... not what I was actually after, but much better in fact. That will work nicely. Thank you.

        M 1 Reply Last reply
        0
        • O orinoco77

          Hmm... not what I was actually after, but much better in fact. That will work nicely. Thank you.

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          It's the "proper" way. :)

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          O 1 Reply Last reply
          0
          • M Mark Salsbery

            It's the "proper" way. :)

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            O Offline
            O Offline
            orinoco77
            wrote on last edited by
            #5

            and it does in fact work a treat. One for the file, I think.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups