views:

49

answers:

2

Hello,

I've the following issue

  • I've a windows application
  • It calls a remote web service (for authentication)
  • It in turns call a web service (in the same remote machine) (to get a licensed file)
  • It saves the licensed file in All Users/Application Data in the system where the application is running

Which permission is used for saving the file in the Application Data folder? Either the web service's or the currently logged windows user's?

Update #1

So, i'm not able to save the license as the web service call is throwing a save error. How can i check the permissions of the folder?

Here is the code for creating my folder

licensePath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MyApp");
            if (!Directory.Exists(licensePath))
                Directory.CreateDirectory(licensePath);

Update #2

If i try to save it in the application's path itself (in bin/debug while debugging the application), it is working fine. Any ideas? I've tried just "C:\test" too. It's not working.

Thank you.

Regards NLV

+1  A: 

It will save the file with the permissions of the user that is running the windows application (which can be different from the logged in user - see RunAs).

Oded
Great! But i'm running the application as a local administrator. (My system is in a domain. But i've assigned my account as the local administrator for my machine). So what could be the problem? How can i check the permissions?
NLV
You asked about what user the application saves as. Is there a different problem that you did not ask? Please update your question with further details.
Oded
What version of Windows? With Windows Vista and 7, you'll be running with a restricted token and unable to write to the All Users area, even if the user account is an administrator.
Ben Voigt
A: 

The permission the windows application is running in.

anselm