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. C#
  4. Quick question about UAC

Quick question about UAC

Scheduled Pinned Locked Moved C#
question
9 Posts 3 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.
  • S Offline
    S Offline
    SimpleData
    wrote on last edited by
    #1

    Hi, Actually this question can fit every category; how can I get the location of application data folder (which I can read/write without elevation)? Thanks.

    S T 2 Replies Last reply
    0
    • S SimpleData

      Hi, Actually this question can fit every category; how can I get the location of application data folder (which I can read/write without elevation)? Thanks.

      S Offline
      S Offline
      Saksida Bojan
      wrote on last edited by
      #2

      SimpleData wrote:

      Actually this question can fit every category; how can I get the location of application data folder (which I can read/write without elevation)?

      Then disable UAC

      S 1 Reply Last reply
      0
      • S Saksida Bojan

        SimpleData wrote:

        Actually this question can fit every category; how can I get the location of application data folder (which I can read/write without elevation)?

        Then disable UAC

        S Offline
        S Offline
        SimpleData
        wrote on last edited by
        #3

        I am not the only one using this application and probably you didn't understand my question.

        S 1 Reply Last reply
        0
        • S SimpleData

          I am not the only one using this application and probably you didn't understand my question.

          S Offline
          S Offline
          Saksida Bojan
          wrote on last edited by
          #4

          I am sorry, I have miss read your question. HOW TO: Determine the Executing Application's Path Another alternative way[^]

          1 Reply Last reply
          0
          • S SimpleData

            Hi, Actually this question can fit every category; how can I get the location of application data folder (which I can read/write without elevation)? Thanks.

            T Offline
            T Offline
            Tony Richards
            wrote on last edited by
            #5

            Try using:

            var path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

            I think that does what you want. Take a look at the Environment.SpecialFolder enumeration, it has some other useful folders in there as well. Hope this helps.

            My Blog: This Blog

            S 1 Reply Last reply
            0
            • T Tony Richards

              Try using:

              var path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);

              I think that does what you want. Take a look at the Environment.SpecialFolder enumeration, it has some other useful folders in there as well. Hope this helps.

              My Blog: This Blog

              S Offline
              S Offline
              SimpleData
              wrote on last edited by
              #6

              Thank you. That was the code I was looking for. But there is a minor problem, at Windows XP it crashes the application, in Vista and 7 it works fine.

              T 1 Reply Last reply
              0
              • S SimpleData

                Thank you. That was the code I was looking for. But there is a minor problem, at Windows XP it crashes the application, in Vista and 7 it works fine.

                T Offline
                T Offline
                Tony Richards
                wrote on last edited by
                #7

                Strange. Do you get an exception? If so, which one? Have you tried stepping through, seeing what is going on just before the crash?

                My Blog: This Blog

                S 1 Reply Last reply
                0
                • T Tony Richards

                  Strange. Do you get an exception? If so, which one? Have you tried stepping through, seeing what is going on just before the crash?

                  My Blog: This Blog

                  S Offline
                  S Offline
                  SimpleData
                  wrote on last edited by
                  #8

                  The application I tested this code is in is a simple console application which I've created just for testing purposes. It contains two lines. This and Console.ReadLine(). It throws an exception but framework is not able to catch it so it is shown as a standart Windows exception. When I check it's details I can only see that it occured in System.Security namespace. It's quite odd.

                  T 1 Reply Last reply
                  0
                  • S SimpleData

                    The application I tested this code is in is a simple console application which I've created just for testing purposes. It contains two lines. This and Console.ReadLine(). It throws an exception but framework is not able to catch it so it is shown as a standart Windows exception. When I check it's details I can only see that it occured in System.Security namespace. It's quite odd.

                    T Offline
                    T Offline
                    Tony Richards
                    wrote on last edited by
                    #9

                    It might be a permissions problem Make sure you're running it from a folder local to the PC and with an administrator account. Try surrounding the code with a try/catch and echoing out the exception to the console, or sticking a breakpoint in the catch block. It might get something Visual Studio might not catch.

                    My Blog: This Blog

                    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