Quick question about UAC
-
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.
-
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.
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
-
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
I am not the only one using this application and probably you didn't understand my question.
-
I am not the only one using this application and probably you didn't understand my question.
I am sorry, I have miss read your question. HOW TO: Determine the Executing Application's Path Another alternative way[^]
-
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.
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
-
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
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.
-
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.
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
-
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
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.
-
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.
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